Python Operators Flashcards

(33 cards)

1
Q

Python Order of Operations

A

PEMDAS

Parentheses 
Exponents
Multiplication
Division
Addition
Subtraction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Addition

A

+

5 + 2 = 7

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

Subtraction

A

-

5 - 2 = 3

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

Multiplication

A

*

2 * 3 = 6

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

Division

A

/

6 / 3 = 2

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

Modular division (Remainder)

A

%

5 % 2 = 1

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

Exponential

A

**

5 ** 2 = 25

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

Floor division

A

//

5 // 2 = 2

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

The assignment operator

A

=

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

Add and reassign.

A

+=

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

Subtract and reassign.

A

-=

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

Multiply and reassign.

A

*=

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

Divide and reassign

A

/=

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

Modular division and reassign

A

%=

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

Floor division and reassign.

A

//=

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

Exponential and reassign

17
Q

Equal

18
Q

Not equal

19
Q

Greater than

20
Q

Less than

21
Q

Greater than or equal

22
Q

Less than or equal

23
Q

and

A

Returns true if both arguments are true

&

24
Q

or

A

Returns true if either input is true.

|

25
not
Returns Boolean inverse ~
26
nor
Returns true if both inputs are false.
27
Nand
Returns true if either input is false.
28
XOR
Returns true if the inputs are different. ^
29
XNOR
Returns true if the inputs are the same.
30
is
Returns true if both variables are the same object.
31
is not
Returns true if both variables are not the same object.
32
in
Returns true if a sequence is in an object.
33
not in
Returns true if a sequence is not in an object.