As you saw by the title, I'm making a guessing game for fun, and ran into the issue of saying something if the input wasn't between 1 and 10 (printing) I tried the thing below, but it just didn't work in general and gave errors:
if guess.isdigit and > 10:
import random
import time
streak = 0
numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
while True:
answer = random.choice(numbers)
insultlist = ["bro the real answer was " + answer + ", how are you even that bad?", "you suck at this, you weren't even close. The correct answer was " + answer + "..", "it's the people like you who make me question the future of this planet. The actual answer was " + answer + ".", "lol u suck, the real answer was " + answer + "."]
insultchoice = random.choice(insultlist)
guess = input("Type a number between 1 and 10! ")
if guess == answer:
print("lol ur lucky, you guessed it correctly.")
streak = streak + 1
streakmsg = f"You're at a streak of {streak}."
print(streakmsg)
time.sleep(1)
print("______________________________________________________")
else:
if guess.isdigit():
print(insultchoice)
if streak > 0:
loststreak = f"You lost your streak of {streak}."
print(loststreak)
streak = 0
time.sleep(1)
print("______________________________________________________")
else:
print("That's not even a number..")
time.sleep(1)
print("______________________________________________________")