#!/usr/bin/python3
# coding=utf-8
from random import *
def ask_a_number ():
return int (input ("Guess: "))
secret_number = 10
attempts = 0
def feedback(guess, secret_number):
if guess < secret_number:
print ("My number is higher")
elif guess > secret_number:
print ("My number is lower")
else:
print ("You won.")
guess = ask_a_number ()
attempts = attempts + 1
feedback (guess, secret_number)
while guess != secret_number:
guess = ask_a_number ()
attempts = attempts + 1
feedback (guess, secret_number)
print ("You took " + str (attempts) + " attempts.")