Код: Выделить всё
import time
import random
score = 0
while True:
print(f"Guess how long you wait from this message to the next one. Your score is {score}")
random_number = random.randint(1, 5)
time.sleep(random_number)
guess = int(input("Okay, Guess now in seconds: "))
if guess == random_number:
print("Good job")
score = score + 1
else:
print(f"Nope, it was {random_number} seconds")
score = 0
Подробнее здесь: https://stackoverflow.com/questions/798 ... improve-it