CSC148H1 Lecture Notes - Lecture 2: Docstring, Memory Address, Init

57 views6 pages
School
Course
Professor
katrinasavvy and 38715 others unlocked
CSC148H1 Full Course Notes
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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents