"/" operator is used for...
division.
starting an if statement/checking if a condition is true.
x = 5
y = 10
print(x * y)
output: 50
A number without decimals.
An Integer.
on = True
off = not on
if off:
print("On")
else:
print("Off")
output: Off
"=" operator is used for...
assigning a value.
checking if multiple conditions are true.
num1 = 305
num2 = 26
num1 = num1 + num2
print(num2)
output: 26
A sequence of characters (text)
A String.
A function that is used for getting the length of a list...
len()
"==" operator is used for...
comparing two values.
The "or" keyword is used for...
checking if one of two or more conditions are true.
name = "Peter"
age = 30
if name == "Peter":
age = age + 20
print(age)
output: 50
A number with decimals...
A function from the "random" library that picks a random entry from a list or array
random.choice()
"**" operator is used for...
calculate the power of a number.
The "not" keyword is used for...
reversing a value, typically a boolean.
if age:
print(age)
else:
print(age + 6)
output: 6
A value that can be true/false...
A Boolean.
The "def" keyword is used for...
defining a function.
get the remainder of a division.
The "while" keyword is used for...
starting a while loop. Double points: A while loop is...
points = 4506
points -= 6
print("points")
output: points
A collection of data represented by a name...
A List.
A function used to sort a list...
sorted()