I have to use the function ask_number() so that is ask the player for a guess with a call to ask_number()
here is my code but it automatically guess the number and i dont know if i did it right
import random
print "\tWelcome to guess my number!"
print "nI'm thinking of a number bewtween 1 and 100."
print "try to guess it in as few attempts as possible.\n"
tries = 1
the_number= random.randrange(100) +1
def ask_number(question, low, high):
"""Ask a yes or no question"""
response = None
while response not in range(low, high):
response = int(raw_input(question))
return response
guess = int(raw_input("take a guess: "))
tries +=1
print "you guess it! the number was", the_number
print "and it only took you", tries, "tries!\n"
raw_input("\n\nPress the enter key to exit.")