Please don't be too harsh because I'm new to coding. The problem I'm having is that the function catch_error_str does not work. For example, when I enter "2" as an input then it says last_name is 2 instead of catching the error.
def catch_error_str():
unvalid = True
while unvalid:
try:
string = str(input())
unvalid = False
return string
except ValueError:
print("You must not enter any numbers")
def surname ():
print("What is the surname of the lead booker ")
last_name = catch_error_str()
print(last_name)
print("Welcome to Copington Adventure Theme Park's automated ticket system\nplease press any button to see the ticket prices.")
enter = input()
print("\nAdult tickets are £20 each \nChild tickets are £12 each \nSenior citizen tickets are £11 each")
surname()