I have a function that evaluates input, and I need to keep asking for their input and evaluating it until they enter a blank line. How can I set that up?
while input != '':
evaluate input
I thought of using something like that, but it didn't exactly work. Any help?
you probably want to use a separate value that tracks if the input is valid:
This is a small program that will keep asking an input until required input is given.
There are two ways to do this. First is like this:
The second is like this:
Note that if you are on Python 3.x, you will need to replace
raw_input
withinput
.Easier way: