high = 11
low = 1
print "welcome to the game"
print " enter username "
username = raw_input()
print "hello" " " + username
print " i will try to guess your number, think of a number between 1 and 10"
guess = (high-low)/2
print "please enter your number"
number = raw_input()
while guess != number:
if number > guess:
low == guess
elif number < guess:
high == guess
else:
print ' your number is ' + str(guess)
guess == (high-low)/2
This post has been edited by Simown: 15 January 2012 - 06:02 AM
Reason for edit:: Added code tags

New Topic/Question
Reply



MultiQuote




|