Python Operators Flashcards

1
Q

*

A

multiplication

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

/

A

division, float

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

//

A

division, integer

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

**

A

exponential (0.5 for sqrt)

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

%

A

modulus, returns remainder after division. x % 10 is the last digit of x and x % 100 is the left two digits, etc.

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

[ ]

A

indexing operator (create lists)

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

[ : ]

A

slice operator

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

in

A

string operator. substring is found in string

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

is

A

returns True if the values of the variables reference the same object (a = ‘banana’, b = ‘banana’, a is b == True)

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