i need the code to ask the play for a guess with a call to ask_number()
here is my code i have a problem in that it won't run can somebody offer me some help? thanks
import random
secretNum = random.randrange(100)+1
tries = 0
while tries < 5:
try:
def ask_number(question, high, low):
"""Ask a yes or no question"""
response = None
while response not in range(low, high):
response = int(raw_input(question))
return response
except ValueError:
print('Please enter a number')
if guess != secretNum:
print('Sorry you ran out of guesses. The correct number was'), secretNum