Operators Flashcards
-
subtract
+
add
*
multiply
**
Exponent - Performs exponential (power) calculation on operators
/
Division
//
Floor Division - The division of operands where any digit after decimal point are removed.
9//2 = 4
<
less than
%
Modulus - Divides left hand operand by right hand operand and returns remainder
>
greater than
<=
less than or equal to
> =
greater than or equal to
==
equal to
!=
not equal to
( )
parathesis
( )
parenthesis for strings ??
[ ]
parenthesis for lists ??
@
?
{ }
parenthesis for ??
,
separates statements with a space
strings, numbers, booleans, variables etc
:
always add at end of first line of any sub-routine.
i.e. def, if, elif, else etc
=
equals
.
signifies a command/ function/ method
i.e. variable.read var1.append
+=
a = 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.