[CSC148H5] - Midterm Exam Guide - Everything you need to know! (65 pages long)

502 views65 pages
7 Feb 2017
School
Course

Document Summary

Lecture 1:1 object orientated programming: function based approach def sqrt(x): Some real world this are not modelled well using this approach def eat_lunch(person,food): Python has a lot of object types built-in: strings tuple, lists dictionaries. You make a new type of object when the built-in ones don"t do what you want. Objects have two important types of features: methods: actions that the object can perform. Some possible methods for turtles: move_right, move_left, turn, forward, backward, hatch_eggs, make_noise, die, y: attributes: what the object has, not what it does. Some possible attributes: position, age, name, relationships, hunger_level, weight, speed You can have many objects at a time and change each object separately without e ecting each other. This does not change all objects just the object u changed. Example: from turtle import* t1 = turtle() t2 = turtle() t1. neck = true print(t1. neck) # true print(t2. neck) # error.

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

Related Documents