while True:
number = input("Pick a number 1-10: ")
try:
number = int(number)
except ValueError:
print(number, 'is not a number, try again.')
continue
if number < irand:
print(" ")
print("That's too high, try again.")
elif number > irand:
print(" ")
print("That's too low, try again.")
else:
print(" ")
print("You got it right! You won!")
break