Answer the question
In order to leave comments, you need to log in
Problems with python code?
Can't execute code:
import random
secret = random.randint(1, 99)
guess = 0
tries = 0
print ("Эй на палубе! Я ужасный пират Робертс, и у меня есть секрет!")
print ("Это число от 1 до 99. Я дам тебе 6 попыток.")
while guess != secret and tries < 6:
guess = input("Твой вариант?")
if guess < secret:
print ("Это слишком мало, презренный пес!")
elif guess > secret:
print ("Это слишком много, сухопутная крыса!")
tries = tries + 1
if guess == secret:
print ("Хватит! Ты угадал мой секрет!")
else:
print ("Попытки кончились!")
print ("Это число "), secret
Traceback (most recent call last):
File "D:\2.py", line 9, in <module>
if guess < secret:
TypeError: '<' not supported between instances of 'str' and 'int'
Answer the question
In order to leave comments, you need to log in
TypeError: '<' not supported between instances of 'str' and 'int
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question