CSC148H1 Lecture Notes - Lecture 2: Docstring, Memory Address, Init
katrinasavvy and 38715 others unlocked
1
CSC148H1 Full Course Notes
Verified Note
1 document
Document Summary
All code seen in the pictures in these notes can be found on the csc148 website: http://www. teach. cs. toronto. edu/~csc148h/winter/ W1 and w2 aren"t objects: they don"t have a type, they reference an object. Is compares the ids of the two variables, which are different since different objects are created (they have a different memory address) W1 == w2: true, compares the values ( words and words , the values are the same. Visual representation of this: w1 id31 w2 id42 id42 str id31 str words words. Double box indicates that object in immutable: strings are immutable. Ex: if __name__ == __main__ : for running doctests. Remember how to write a function using the function design recipe because it will be needed for designing classes: needed for methods, which are used in classes. Ex: x horizontal position, etc: describe the attributes x: float, declare type of attributes. Takes point self and value any and tells you if they"re equivalent.