random
A module for making random choices. random.randint(1, 6) gives a whole number from 1 to 6, like rolling a dice.
import random
roll = random.randint(1, 6)
print(1 <= roll <= 6)
Output
True
See: Lesson 21: Modules: ready-made code coming soon
range()
A function that makes a sequence of whole numbers. range(3) gives 0, 1, 2; range(1, 4) gives 1, 2, 3. It stops before the end number.
for n in range(1, 4):
print(n)
Output
1
2
3
See: Lesson 13: Repeating with for and range() coming soon
return
A keyword that sends a value back from a function to the code that called it, and ends the function.
def double(n):
return n * 2
print(double(21))
Output
42
See: Lesson 20: Parameters and return coming soon
run
To make the computer carry out a program's instructions. In the editor, press Run (or Ctrl + Enter).
print("Running!")
Output
Running!
See: Lesson 1: What is programming?