import random
n = 1
tala = random.randrange(0,11)
print('talan er ' + str(tala))
print('The goal is to guess the number.')
num = input('Pick a number: ')
while num != tala:
if num < tala:
print('Too Low')
num = input('Try again: ')
elif num > tala:
print('Too High')
num = input('Try again: ')
else:
print('wow congratulations, you guessed the right number in ' + str(n) + ' tries.')
n += 1
Above is my code, and below is the error that I am encountering.
I can't seem to find my error which is: It's just a simple code, but the error is something I can't find.
Traceback (most recent call last):
File "C:/Users/ebben/PycharmProjects/HelloWorld/GuessNumber.py", line 10, in <module>
if num < tala:
TypeError: '<' not supported between instances of 'str' and 'int'