I have been trying to write this code and I need a way of stopping the code if a certain input is incorrect, here is what I have so far:
first_name = input('PLEASE ENTER YOUR FIRST NAME: ')
last_name = input('PLEASE ENTER YOUR SURNAME: ')
print(f'Hello {first_name} {last_name}, before you enter.')
def age_det():
age = input(f'How old are you?')
converted_age = [int(age)]
for num in converted_age:
while num>=18:
print(f'Awesome, {first_name}, welcome to Blablabla')
num += 100
while num <= 18:
break
print(f'Sorry, {first_name}, but we require you to be at least 18 to enter Blablabla.')
num += 100
age_det()
#I want the code to stop here if the age entered is under 18
username = input('Before we start, please pick a username: ')
print(f'Woah! {username}, good choice!')