Python Operators Flashcards

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

A

**=

17
Q

Equal

A

==

18
Q

Not equal

A

!=

19
Q

Greater than

A

>

20
Q

Less than

A
21
Q

Greater than or equal

A

> =

22
Q

Less than or equal

A

<=

23
Q

and

A

Returns true if both arguments are true

&

24
Q

or

A

Returns true if either input is true.

|

25
Q

not

A

Returns Boolean inverse

~

26
Q

nor

A

Returns true if both inputs are false.

27
Q

Nand

A

Returns true if either input is false.

28
Q

XOR

A

Returns true if the inputs are different.

29
Q

XNOR

A

Returns true if the inputs are the same.

30
Q

is

A

Returns true if both variables are the same object.

31
Q

is not

A

Returns true if both variables are not the same object.

32
Q

in

A

Returns true if a sequence is in an object.

33
Q

not in

A

Returns true if a sequence is not in an object.