CSCA08H3 Lecture Notes - Init, Camel Case

50 views1 pages
1 Feb 2013
School
Course

Document Summary

Class type of an object (data that they store) Ie) list class but each instantiation can be edited/changed. Don"t relaly need exs) in docstring (not new!) My_str is an object of str class & method ljust. Start with classname: camelcase not pot_hole_case: caps, no spaces/underscores. Must have __init__ (don"t expect user to ever call) Defines code that runs when new obj of this type is created. __str__ setup default parameter: returns desired output when object of this class is cast to a str or printed. Every method (built-in too) gets implicitly passed a copy of the obj itself. Don"t include in method call, method def"n.

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