Welcome to the Treehouse Community
Looking to learn something new?
What loop should I use to efficiently ask for the input again if a Value error occurs?
I would like to find out how i can loop the code n the video to ask for input again if a Value error happens, without needing to type the entire code again.
Robert Lyon7,551 Points
You could use a while loop to ask for input again. Here is a simple example of asking for input again, hope it helps.
word = input("what is the greeting?") while word != "hello": word = input("what is the greeting?")