**`I N D E X`**

Basic Concepts

Mathematical Operations

In-Place Operators

go to top

In-place operators: allows code such as ‘x=x+3’ to be written more concisely, replacing the old variable being worked on, Can be used with any numerical operators (+, -, *, /, %, **, //)

x -= 2
x /= 3
x *= 5

can also be used for string concatenation

x = 'spam'
print(x)

x += 'eggs'
print(x)

Data Types

go to top

Data Name Definition Example
String text enclosed in single or double quotes “Hello world” or ‘Hello world’
Integer whole numbers (can be used in mathematical operations) 42 or 12
Float A decimal number, caused by division (can be used in mathematical operations) 42.5 or 12.0

Strings Explained


Comments & Docstrings

go to top


Print Command

go to top