Operators Flashcards

1
Q

Python Operator: +

A

Addition

Definition: Adds two operands. Example: a + b

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

Python Operator: -

A

Subtraction

Definition: Subtracts the second operand from the first. Example: a - b

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

Python Operator: *

A

Multiplication

Definition: Multiplies two operands. Example: a * b

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

Python Operator: /

A

Division

Definition: Divides the first operand by the second. Example: a / b

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

Python Operator: %

A

Modulus

Definition: Returns the remainder of division. Example: a % b

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

Python Operator: **

A

Exponentiation

Definition: Raises the first operand to the power of the second. Example: a ** b

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

Python Operator: //

A

Floor Division

Definition: Divides and returns the largest possible integer. Example: a // b

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

Python Operator: ==

A

Equal

Definition: Checks if two operands are equal. Example: a == b

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

Python Operator: !=

A

Not Equal

Definition: Checks if two operands are not equal. Example: a != b

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

Python Operator: >

A

Greater Than

Definition: Checks if the left operand is greater than the right. Example: a > b

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

Python Operator: <

A

Less Than

Definition: Checks if the left operand is less than the right. Example: a < b

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

Python Operator: >=

A

Greater Than or Equal To

Definition: Checks if the left operand is greater than or equal to the right. Example: a >= b

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

Python Operator: <=

A

Less Than or Equal To

Definition: Checks if the left operand is less than or equal to the right. Example: a <= b

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

Python Operator: and

A

And

Definition: True if both operands are true. Example: a and b

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

Python Operator: or

A

Or

Definition: True if at least one operand is true. Example: a or b

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

Python Operator: not

A

Not

Definition: Inverts the truth value of the operand. Example: not a

17
Q

Python Operator: =

A

Assign

Definition: Assigns a value to a variable. Example: a = b

18
Q

Python Operator: +=

A

Add and Assign

Definition: Adds and assigns a value. Example: a += b

19
Q

Python Operator: -=

A

Subtract and Assign

Definition: Subtracts and assigns a value. Example: a -= b

20
Q

Python Operator: *=

A

Multiply and Assign

Definition: Multiplies and assigns a value. Example: a *= b

21
Q

Python Operator: /=

A

Divide and Assign

Definition: Divides and assigns a value. Example: a /= b

22
Q

Python Operator: %=

A

Modulus and Assign

Definition: Modulus and assigns a value. Example: a %= b

23
Q

Python Operator: **=

A

Exponentiation and Assign

Definition: Exponentiation and assigns a value. Example: a **= b

24
Q

Python Operator: //=

A

Floor Division and Assign

Definition: Floor division and assigns a value. Example: a //= b

25
Python Operator: &
Bitwise AND ## Footnote Definition: Performs bitwise AND. Example: a & b
26
Python Operator: |
Bitwise OR ## Footnote Definition: Performs bitwise OR. Example: a | b
27
Python Operator: ^
Bitwise XOR ## Footnote Definition: Performs bitwise XOR. Example: a ^ b
28
Python Operator: ~
Bitwise NOT ## Footnote Definition: Performs bitwise NOT. Example: ~a
29
Python Operator: <<
Left Shift ## Footnote Definition: Shifts bits to the left. Example: a << b
30
Python Operator: >>
Right Shift ## Footnote Definition: Shifts bits to the right. Example: a >> b