Код: Выделить всё
import random
target = random.randint(1,100)
counter = 0
print(target)
print(int(input('Guess an integer between 1 and 100 ')))
guess = input
while guess != target():
if guess > target():
print("Guess is to high")
elif guess < target():
print("Guess was to low")
counter = counter + 1
print(int(input('Guess an integer between 1 and 100 ')))
print("Correct it took you " + str(counter) + " guesses to get the correct number")
Подробнее здесь: https://stackoverflow.com/questions/741 ... r-im-gener