Tsm is unable to continue. exiting program

broken image
broken image

And using an exit is fine when he says No, just remember that it will exit the whole program, so if you want to do something else after he says no, it might be better to use return and put them into functions. You actually need to break the while loop when the user says Yes, so you can proceed to the 2nd question. Please answer in a not so technical way, as my knowledge of python is very limited, still trying to learn. I through after picking up some suggestion here, that I could use a while loop, but as the question stands, I did not get it right. So basically I want the program to exit on no, but continue on yes with the next question which is 'Please tell me the first letter in your surname?' Lastname = input('Please tell me the first letter in your surname?').lower()ĭEMO - If the user answer 'yes' Do you want me to guess your name? yes/no :ĭo you want me to guess your name? yes/no : while True:Īnswer = input('Do you want me to guess your name? yes/no :') But I figured out how to break if the user answer now, but when the user says yes it just re-enter the loop again with the same initial question. I have a python3 program that guesses the last name of an individual based on the input of the user.

broken image