Improve the function ask_number()so that the function can be
called with a step value. Make the default value of step 1.
Here's the function
Expand|Select|Wrap|Line Numbers
- def ask_number(question, low, high):
- """Ask for a number within a range."""
- response = None
- while response not in range(low, high):
- response = int(input(question))
- return response