CSC108H1 Lecture : november 30 notes

35 views3 pages
11 Jan 2013
School
Course
yifanyang and 39659 others unlocked
CSC108H1 Full Course Notes
21
CSC108H1 Full Course Notes
Verified Note
21 documents

Document Summary

Classes have methods, can called methods on objects. Using ojects: you have used many kinds of objects that are built in python: int, str, list, >>> total = 0 #create a new int object. >>> ex. name = priya" # create a new str object: and others that are part of modules you had to import such as media. >>> p = media. get_pixel(pic, 3, 92) # returns a pixel object. Defining new types of objects: consider a calendar program. Messy: or we could define a new type of object to bundle these together, we have int, str, dict, list, ect. >>> e1 = event() # assigns e1 as an object. # can"t add instance variables in built in classes like strings. { start":9, end":10, name": 108 lecture"} # kept in dictionary. { start":9, end":10, name": 108 lecture", location": ba 1220"} # kept in dictionary.

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