Operators

SymbolsFunction
+, -, *, /Addition, Subtraction, Multiplication and Division
**Exponentiation
//Integer Divison
%Modulo Operation
Operation NameOperatorExplanation
less than<Less than operator
greater than>Greater than operator
less than or equal<=Less than or equal to operator
greater than or equal>=Greater than or equal to operator
equal==Equality operator
not equal!=Not equal operator
logical andandBoth operands True for result to be True
logical ororOne or the other operand is True for the result to be True
logical notnotNegates the truth value, False becomes True, True becomes False
Operation NameOperatorExplanation
indexing[ ]Access an element of a sequence
concatenation+Combine sequences together
repetition*Concatenate a repeated number of times
membershipinAsk whether an item is in a sequence
lengthlenAsk the number of items in the sequence
slicing[ : ]Extract a part of a sequence