I&C SCI 33 Study Guide - Midterm Guide: Regular Expression, Tuple, Function Object

729 views23 pages

Document Summary

Avoid use of read()/readlines(), instead, directly iterate over open file objects by line. Is operator: x = [ a", b"], y = [ a", b"] X is y returns false but x == y returns true. The names x and y are bound to/refer to two different list objects, but the two objects store the same state ( a" at index 0 and b" at index 1) If you did x = [ a", b"] and y = x then x is y returns true and x == y returns. True, because x and y are referring to the same list object. X= [1, 2, 3] represented by: x list. X. append(4) represented by i i x list. X[2] = 5 represented by x list. Representing an object constructed from dice class. Def bigger_than(v): def test(x): return x > v return test. Legb rules: python uses this when it looks up the binding of names.

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

Related Questions