FIT1045 Final: Extra info

64 views2 pages
Use quit()/pass for while. 'break' expects to be inside a loop, and 'return' expects to
be inside a function.
To break a loop, use break instead of return.
Or put the loop or control construct into a function, only functions can
return values.
print("Area is ",area)
No#need#to#convert#area to#a#string,#makes#life#easier#too.
Mutable#(can#change):#lists,#tables
Immutable#(unable#to#change#w/o#reassigning):#integers,#Boolean,#floats,#strings
For mutable objects (e.g., list),
x *= 2 changes the object in-place,
The same holds for + operation, e.g., x += [2,3] is in-place where as x
= x + [2,3] changes the identifier of x
X#=#10
X#*= 3#[also#works#for#+=,#-=#etc]
>>>#30
'There\'s#a#snake#in#my#boot!'
now.year/month/day
now.hour/minute/second
Extras
Wednesday,# 9#August#2017
11:22
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

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