Class Notes (838,271)
Canada (510,816)
CSC108H1 (113)
Lecture

november 30 notes

3 Pages
114 Views
Unlock Document

Department
Computer Science
Course
CSC108H1
Professor
Michelle Craig
Semester
Fall

Description
Classeshave methods can called methods on objectsUsing Ojects o You have used many kinds of objects that are built in Python int str list total0 create a new int objectEx namePriyacreate a new str object o And others that are part of modules you had to import such as mediaimport miedapmediagetpixelpic 3 92returns a pixel objectDefining new types of objects o Consider a calendar program One of the basic things youd need to keep track of is events o What should we keep track of for a single event o We could define individual variables for each of these but wed need to do that for every event Messy o Or we could define a new type of object to bundle these together o We have int str dict list ect Now we can have EventClass event 1 class Eventobject2 passe1Eventassigns e1 as an objecte1mainEvent object at 12314123e2Eventanother evente1name108 Lecturee1start9e1end 10print e1start 9print e1end 10print e1mainEvent object at 1251234123dire1 bult in methods end name
More Less

Related notes for CSC108H1

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit