Essentially I'm just wondering if there's any way to make this code more concise. I don't even really know how to properly ask the question, but is there a module or expression I could write or import to help?
while True:
try:
guess = int(input("Enter a number here: "))
break
except:
print("Please try again.")
In free language it would probably look like:
test:
dothing("user thing")
if issues:
print("try again")
try again
I'm trying to prevent an error from the user typing something like a string and breaking the entire program. If this seems stupid, I apologize; I'm starting to get into Python again after what is essentially years of not using it and I'm probably forgetting something simple.
Thank you guys so much in advance.