Basics Flashcards

1
Q

Addition, substraction, multiplication

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

Division

regular, modulo, remainder

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

Booleans

A
3 == 3
3 != 3
(1 != 1) & (1 < 1)
(1 == 1) | (1 < 1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Create lists

A
x = [1,2,3,4,5]
y = ['a','b','c','d','e']
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Assign a variable

A

a=7

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

Print object

A

print(a)

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

Get type of an object

A
type(9) #int
type(99.55) #float
type('a') #str
type(5+2.0) #float
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What Matt was talking about

A
a=7
print(a)
b=a
print(b)
a=5
print(b)
print(a)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define multiple objects

A
trois=three=tres=3
print(three)
print(trois)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Verify type of an object

A
type(7)==int
isinstance(7,int)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Basic loop

A
for x in range(10):
    print(x)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Clear console

A

clear(x)

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

Concatenate strings

A
x='0' 
y='9' 
xy = x + y
print(xy)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Display credit

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

Get python version (in terminal)

A
python -V
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Append lists

A
x = [1,2,3,4,5]
y = ['a','b','c','d','e']
x + y