def user_input():
a = input('Enter Ozone level here:')
try:
user_num = float(a)
except:
print('Invalid')
user_input()
return user_num
a = user_input() print(a)
When I first input a number, the function worked just fine. However, When I enter a string first and then a number after error handling, there's an error: UnboundLocalError: local variable 'user_num' referenced before assignment.