Currently i have this:
try:
number = int(input('Please enter a number greater than 20'))
if number > 20:
print(number)
except ValueError:
print('We encountered an error. Please try again.')
Is there a way to integrate the if statement into try? Basically so that if the input is not greater than 20 it goes to the except ValueError line. I kind of understand how the try statement works but i can only use it for really simple things, i tried reading up on it and i just got confused. Any help would be greatly appreciated.