Functions in Python Common

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Functions in Python

Common:
def = define
; closes
return = return result
# comments
Have definable parameters

re:function

correct answer most important, efficiency later

Value for value of none if nothing assigned

Viz mode (e.g. wrench) allows you to review steps


 Objects and frames
 Variables mapped to definitions
 Breakpoints -> only cases appear

See tutorial for basic operations


% - modulo
can use modulo for screen positon
(screen wrapping)

Data Conversion
-#’s to strings
str  to string modules  imports + operator in strings joins them together

Boolean logic
Not, and, or
comparison operations (the same)
if – then statements (same)
w/ Booleans
else
elif (elseif)
names are case sensitive in Python

You might also like