• 1 2 3 100 13151 0
• 1.5 2.048128 3.000001
• "Hi! I’m Alessio Vaccaro"
• [1, 2, 7, 10]
• (1, 2, 7, 10)
• { "age":"28", "hair":"none" }
• True False
string my_string
string [x]
string [:x] [x:]
type()
list my_list 1 2 3
[x]
list[x]
list[x] = value
list tuple list tuple
my_dict dictionary
values keys
“name” “Alessio”“age” 28
value dictionary key
keys dictionary
keys dictionary
keys() keys dictionary
if
if hot:open_the_window
if BOOLEAN_EXPRESSION:STATEMENT
if valueToCheck 22
valueToCheck > 22 True
if True False
if-else
forlist for
for list listOfNumbers
range()
for list range()
while BOOLEAN_EXPRESSION True
while BOOLEAN_EXPRESSION:STATEMENT
while
number = number - 1
function
function
def my_function(argument1):
do_something_with_my_argument1
return(result)
module functions
module library
module “time” functions
math module
sin function math module
module “math”
math.pi math.sin()
pi math sin()
Functions attributes
module “random”
rand.int() function
attribute/function module
dir() function