CP164- Final Exam Guide - Comprehensive Notes for the exam ( 31 pages long!)

398 views31 pages
School
Course
Professor

Document Summary

Collection - must be as required by post conditions. Assert - empty if not in format. Check if data structures are empty before because assertion will fail if they are. Store value in object (parameter we want in object) Self= keyword that means the current object. Without self" it is just a variable, not object. Whenever we want attribute from object, enter self". As an object it has a student id attribute therefore by entering self you are retrieving that value. Must identity certain things ( such as origin of food,) Must have following attributes( name(str), origin(int),is_vegetarian (boolean), calories (int>0) Name of class is capital f (food class) Food pydev module(lower case) ** case is important in submitting assignments!!! Origin not have self in front that means it belongs to all food objects ( only need one copy) Method that belongs as class as a whole ( origins- belongs to class)

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