# Reverse Python Guessing game

Page 1 of 1

## 1 Replies - 3294 Views - Last Post: 14 January 2012 - 05:47 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=262870&amp;s=ef9f78d63ac954d727d15da03c70cdfa&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 emrah.dgd

Reputation: 0
• Posts: 1
• Joined: 13-January 12

# Reverse Python Guessing game

Posted 13 January 2012 - 08:29 PM

I keep trying to reverse the python guessing game. I am trying to get python to guess my number. I can't seem to do it, could someone help me with this.

```high = 11

low = 1

print "welcome to the game"

print "hello" " " + username

print " i will try to guess your number, think of a number between 1 and 10"

guess = (high-low)/2

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

Is This A Good Question/Topic? 0

## Replies To: Reverse Python Guessing game

### #2 William_Wilson

• lost in compilation

Reputation: 206
• Posts: 4,809
• Joined: 23-December 05

## Re: Reverse Python Guessing game

Posted 14 January 2012 - 05:47 PM

I won't solve your problem for you, but I think I can head you in the right direction.
*Please use code tags in the future around your code as especially with Python tabbing is crucial to logic.