0% found this document useful (0 votes)
15 views

Functions in Python Common

Functions in Python allow you to define reusable blocks of code using the def keyword and ; to close. Parameters can be passed into functions and a return value specified. Comments are denoted with #. The visual mode in Python allows you to review function steps including objects, frames, variables, and breakpoints. Common operations like modulo (%) and data conversions between numbers and strings can be performed. Boolean logic uses operators like not, and, or in if/elif/else conditional statements.

Uploaded by

gorrilaz59158
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Functions in Python Common

Functions in Python allow you to define reusable blocks of code using the def keyword and ; to close. Parameters can be passed into functions and a return value specified. Comments are denoted with #. The visual mode in Python allows you to review function steps including objects, frames, variables, and breakpoints. Common operations like modulo (%) and data conversions between numbers and strings can be performed. Boolean logic uses operators like not, and, or in if/elif/else conditional statements.

Uploaded by

gorrilaz59158
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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