[Tutor] step value
Vincent Balmori
vincentbalmori at yahoo.com
Mon Jun 13 11:02:33 CEST 2011
I am stuck on a question for Absolute Beginner's. I googled this and there have
been others who have not understood the question and I am also not clear on the
question he is asking. This function is a part of a tic tac toe program."Improve
the function ask_number() so that the function can be called with a step value.
Make the default value of step 1."
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110613/a9bdf9d2/attachment.html>
More information about the Tutor
mailing list