Friday, January 30, 2015

Week4:Impression of first few weeks

In the past weeks, we learned about how to design the class and subclass.
Since I took a CSC108 last semester, it was not too difficult to understand the method that we use like 
__init__, __str__, __eq__. However I was not able to find difference between method __repr__ and __str__.  Doing A1, me and my partner having trouble with this problem first time, but keep searching and asking about this, i got some concept about the difference between them. (Both __repr__ and __str__ are used to "represent" and object. __repr__should be "official " representation while __str__ is the "informal" representation.)

No comments:

Post a Comment