Dec-28-2024, 05:41 AM
Guys have a question and cant seem to find the solution anywhere, most places are telling me to create a loop:
LINE1: user_name = input('what is your name')
LINE2: print('Ok, so your name is: ' + user_name + ', correct? Please type "Y" or "N" ')
LINE3: birth_date = input('Next, please enter your birthdate')
# I want to have this where if the user selects "Y" it carries on to the next line of code, LINE 3
If the user selects "N" I want it to go revert back to LINE1
Please let me know if there is a way to code this
Thanks!
Colin
LINE1: user_name = input('what is your name')
LINE2: print('Ok, so your name is: ' + user_name + ', correct? Please type "Y" or "N" ')
LINE3: birth_date = input('Next, please enter your birthdate')
# I want to have this where if the user selects "Y" it carries on to the next line of code, LINE 3
If the user selects "N" I want it to go revert back to LINE1
Please let me know if there is a way to code this
Thanks!
Colin