Python Flashcards
1
Q
A
print “” + “”
2
Q
variable
A
variable = “”
3
Q
modelo operator
A
remainder = X % Y
remainder after x is divided by y
4
Q
updated variable
A
variable name += variable or amount adding
5
Q
make a comment not included in code
A
#
6
Q
decimal
A
called a float
written as 1. or 1.0 or 1.5 or 1.5e2(150) or float(x)/y
7
Q
multi-line strings
A
””“;lklkasdf
;lkajsd;flj
;akjsdf;l”””
8
Q
boolean
A
a = True
b = False
must be capital T and F
9
Q
timestamp
A
First have to import with "from datetime import datetime" Then options are: datetime.now() now.year now.month now.day now.hour now.minute now.second
10
Q
string methods
A
.capitalize() .lower() .isdecimal .isalpha() .find('p') .endswith('x') .split('-') '_'.join() .format()