Operator
Description
Example
+
Concatenation — Adds values on either
side of the operator
One of Python’s coolest features is the string format operator %. This operator is unique to strings and makes up for the pack of having functions from C’s printf() family.
Example:
Backslash
Notation
Hexadecimal
Character
a
0x07
Strings in Python are identified as a continuous set of characters in between quotation marks.
Python allows for either pairs of single or double quotes. Subsets of strings can be taken using the slice operator ([] and [:]) with indexes starting at 0 in the beginning of the…
Function
Returns(description)
Choice(seq)
A random item from a list, tuple, or string
Randrange([start,] stop[,step])
Returns (description)
Abs(x)
The absolute value of x: the (positive) distance between x and zero.
Ceil(x)