Trying to accept only text as input in my program, this is a snippet where I'm having trouble.
def askStr(th):
try:
a = str(input(th))
except ValueError:
raise ValueError("You may only enter a string (letters.)")
if "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" in a:
raise TypeError("No. Only enter letters.")
return a
When I enter a number, it raises the error as expected. BUT, when I enter anything else, only letters, it still gives me the error. No idea what to do here.