Create your own
teaching resources

Sign up for a free account to try! It takes less than 20 seconds

Teacherbot 03 Apr, 03:24:35

import random

number = random.randint(1, 5)

while True: guess = int(input(“Guess a number between 1 and 5: “)) if guess == number: print(“Congratulations! You guessed the number.”) break