I am coding a mock sign up page for a game or something or other, at the end of the code I want to confirm that the user entered data is correct. I do this by typing.
#User sign up page.
#Getting the user's information.
username = input ("Plese enter your first name here: ")
userage = input ("Please enter your age here: ")
userphoneno = input ("Please enter your home or mobile number here: ")
#Showing the inforamtion.
print ("\nIs the following correct?\n")
print ("•Name:",username)
print ("•Age:",userage)
print ("•Phone Number:",userphoneno)
#Confirming the data.
print ("\nType Y for yes, and N for no. (Non-case sensitive.)")
answer = input ("• ")
if answer == 'Y'or'y':
print ("Okay, thank you for registering!")
break
else:
#Restart from #Getting the user's information.?
My problem arises in the last section of code. The program ends like normal when "Y or y" is entered, but I can't seem to work out how to let the user re enter their data if "N or n" is entered. I tried a While loop, which I'm guessing is the solution, but I couldn't seem to get it to work correctly.
Any help would be greatly appreciated. Thanks!