Operators Flashcards

1
Q

-

A

subtract

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

*

A

multiply

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

+

A

add

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

**

A

Exponent - Performs exponential (power) calculation on operators

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

/

A

Division

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

less than

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

%

A

Modulus - Divides left hand operand by right hand operand and returns remainder

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

>

A

greater than

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

<=

A

less than or equal to

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

> =

A

greater than or equal to

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

==

A

equal to

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

!=

A

not equal to

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

( )

A

parathesis

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

//

A

Floor Division - The division of operands where any digit after decimal point are removed.
9//2 = 4

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

( )

A

parenthesis for strings ??

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

@

A

?

17
Q

{ }

A

parenthesis for ??

18
Q

[ ]

A

parenthesis for lists ??

19
Q

,

A

separates statements with a space

strings, numbers, booleans, variables etc

20
Q

=

A

equals

21
Q

.

A

signifies a command/ function/ method

i.e. variable.read var1.append

22
Q

+=

A

a = a + ?

23
Q

;

A

; is a redundant symbol in Python.
However it is often seen because it is a common syntax of other languages.
It is therefore used by habit by programmers.
It basically does nothing, it does not affect code in anyway.

24
Q

-=

A

a = a - ?

25
Q

*=

A

a = a * ?

26
Q

/=

A

a = a / ?

27
Q

:

A

always add at end of first line of any sub-routine.

i.e. def, if, elif, else etc

28
Q

//=

A

a = a //?

29
Q

%=

A

a = a % ?

30
Q

**=

A

a = a ** ?

31
Q

is

A

object identity
Evaluates to true if the variables on either side of the operator point to the same object and false otherwise.
x is y, here is results in 1 if id(x) equals id(y).

32
Q

is not

A

negate object identity
Evaluates to false if the variables on either side of the operator point to the same object and true otherwise.
x is not y, here is not results in 1 if id(x) is not equal to id(y).

33
Q

and

A

Called Logical AND operator. If both the operands are true then then condition becomes true.

34
Q

or

A

Called Logical OR operator. If both or either the operands are true then then condition becomes true.

35
Q

not

A

Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false.
i.e. not(a and b) = not (true) = not true = false

36
Q

in

A

Evaluates to true if it finds a variable in the specified sequence and false otherwise.

x in y, here in results in a 1 if x is a member of sequence y.

37
Q

not in

A

Evaluates to true if it does not finds a variable in the specified sequence and false otherwise.

x not in y, here not in results in a 1 if x is not a member of sequence y.

38
Q

< >

A

redundant legacy operator.

use (!=) is not equal to