2016年1月28日星期四

week3

Slog of Week 3



During the first three weeks’ lecture, I learned about class. I was amazed when I saw the perfect square and the perfect triangle showed on the screen. It is the first time I thought about python could do a lot of things way more interesting than just get a list of students name or make dictionary. 

However, the class material was confused at first. I could not follow the lecture in the first hour. I kept reading the code of ‘Shape’ again and again, and tried some code by myself. Then I felt a little confident. From the last week’s lecture I couldn’t figure out what a subclass is. But in this lecture I understand how to make a subclass. 

In the class I learned a lot of materials, which not only about coding, but also the ideas. I love the discussion part on the lecture. Our professor let us talk about ‘is a’ and ‘has a’ relationship. After the discussion, I think I get a much clearer understanding on ‘class’, ‘object’, and ‘instance’.

A object could be a class, but class is not an object. For example, a chair is an object. When people ask me to bring a chair, then the ‘chair’ is a object. The class attribute of ‘chair’ could be the concept definition of color, but the object attribute could be color of the chair.

Although in the lecture, our professor guide us to write the class of ‘Shape’. But I will rewrite the ‘Shape’ python code so that I could learn the material better. And I am looking forward to learn more about subclasses and inheritance in next week’s lecture. I hope I could do a good job in this course!



没有评论:

发表评论