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
Я сделал это на code.org. Я начал программировать только на прошлой неделе и только научился. Как, по вашему мнению, я могу улучшить ситуацию?
[code]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 [/code] Я сделал это на code.org. Я начал программировать только на прошлой неделе и только научился. Как, по вашему мнению, я могу улучшить ситуацию?