Operators Flashcards

1
Q

+

A

Addition

…2 + 4 == 6

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

-

A

Subtraction

…2 - 4 == -4

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

*

A

Multiplication

…2 * 4 == 8

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

**

A

Power of

…2 ** 4 == 16

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

/

A

Division

…2 / 4 == 0.5

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

//

A

Floor division

…2 // 4 == 0

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

%

A

String interpolate or modulus

…2 % 4 == 2

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

<

A

Less than

…4 < 4 == False

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

>

A

Greater than

…4 > 4 == False

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

<=

A

Less than or equal

…4 <= 4 == True

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

> =

A

Greater than or equal to

…4 >= 4 == True

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

==

A

Equal

…4 == 5 == False

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

!=

A

Not equal

…4 != 5 == True

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

( )

A

Parentheses

…len(‘hi’) == 2

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

[ ]

A

List brackets

…[1, 3, 4]

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

{ }

A

Dict curly braces

…{‘x’: 5, ‘y’: 10}

17
Q

@

A

At (decorators)

…@classmethod

18
Q

,

A

Comma

…range(0, 10)

19
Q

:

A

Colon

…def X(0):

20
Q

.

A

Dot

…self.x = 10

21
Q

=

A

Assign equal

…x = 10

22
Q

;

A

Semi-colon

…print(“hi”); print(“there”)

23
Q

+=

A

Add and assign

…x = 1; x += 2

24
Q

-=

A

Subtract and assign

…x = 1; x -=2

25
Q

*=

A

Multiply and assign

…x = 1; x *= 2

26
Q

/=

A

Divide and assign

…x = 1; x /= 2

27
Q

//=

A

Floor divide and assign

…x - 1; x //= 2

28
Q

%=

A

Modulus assign

…x = 1; x %= 2

29
Q

**=

A

Power assign

…x = 1; x **= 2