CSC148H1 Lecture Notes - Cartesian Coordinate System, Memory Address, Camel Case

39 views3 pages
11 Jan 2013
School
Course
Professor
katrinasavvy and 38715 others unlocked
CSC148H1 Full Course Notes
1
CSC148H1 Full Course Notes
Verified Note
1 document

Document Summary

Even the simplest data structures (like ints) come with all kinds of built-in behaviours. Classes: all objects of a particular type share common behavior and traits. For ex. all the lists are indexable: a class is a type in python, and describes an object"s state and behaviour, we define a class with the following syntax: class classname(object): Style reminder: class names: camelcase capitalized, method names: pothole_case. All lowercase, words separated with underscores: variable names: pothole_case. All lowercase, words separated with underscores: constant names: all_caps_with_underscores. These are constant by convention: you can still assign to them, but this will confuse other programmers: instance variables, private methods: _beginning_underscore. Http://www. python. org/dev/peps/pep-0008: key sections: code lay-out, whitespace in expressions and statements, naming conventions. Initializers: as we have seen, classes are abstract definitions/blueprints/templates. Person: in contrast, objects are concrete entities in memory with addresses and data in them.

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