Step 1: Beans in the jar
Python comes with a library of ready-made tools, grouped into modules. import random at the top
of game.py brings in the one for chance, and random.randint(1, 100) picks a whole number from 1
to 100, both ends included. Every Run fills the jar differently.
Ask for one guess and say how it went:
Guess: 50
Too high
Too low when the guess is below the number of beans, Too high when it's above, Exactly! when
it's the number. That's an if, an elif and an else, the Level 2 kind.
Press Run and type a guess in the terminal. You can't know the answer, and neither could the
check, so it sets beans to a number it picks before it plays.
game.py, the file you edit6 lines
# Sam's jar game: how many coffee beans are in the jar?
import random
beans = random.randint(1, 100) # Sam fills the jar: a whole number from 1 to 100
# TODO (Step 1): ask "Guess: ", turn it into a number, and print Too low, Too high or Exactly!