Python Flashcards

1
Q

print

A

print “” + “”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

variable

A

variable = “”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

modelo operator

A

remainder = X % Y

remainder after x is divided by y

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

updated variable

A

variable name += variable or amount adding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

make a comment not included in code

A

#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

decimal

A

called a float

written as 1. or 1.0 or 1.5 or 1.5e2(150) or float(x)/y

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

multi-line strings

A

””“;lklkasdf
;lkajsd;flj
;akjsdf;l”””

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

boolean

A

a = True
b = False
must be capital T and F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

string methods

A
.capitalize()
.lower()
.isdecimal
.isalpha()
.find('p')
.endswith('x')
.split('-')
'_'.join()
.format()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly