<div>Check this:</div>
<div>&nbsp;</div>
<div>###########################################################</div>
<p>import random</p>
<p>print &quot;Welcome to 'Guess Your Number'!&quot;<br>print &quot;\nThink of a number between 1 and 100.&quot;<br>print &quot;And I will try and guess it!\n&quot;<br>print &quot;Valid inputs are: higher, lower and correct.&quot; 
</p>
<p>raw_input(&quot;\n\nPress enter once you have thought of a number.&quot;)</p>
<div><br># set the initial values<br>x = 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ## Pay atention to these two variables.<br>y = 100&nbsp;</div>
<div>guess = random.randrange(x, y) ## Now we use them<br>tries = 1</div>
<p>&nbsp;</p>
<p># guessing loop<br>response = &quot;&quot;<br>while response != &quot;correct&quot;:<br>&nbsp;&nbsp; print &quot;Is it&quot; ,guess, &quot;?\n&quot;<br>&nbsp;&nbsp; response = raw_input (&quot;&quot;)<br>&nbsp;&nbsp; if response == &quot;lower&quot;: 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y = guess ##&nbsp;y is the 100 above, now, we take the&nbsp;guess as &quot;y&quot; and&nbsp;&quot;y&quot; as the maximum value of the parameters of guess.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; guess = random.randrange(x, y)<br>&nbsp;&nbsp; elif response == &quot;higher&quot;: 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x = guess<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; guess = random.randrange(x, y) ##&nbsp;we take guess as the minimun value of&nbsp;our guess&nbsp;and&nbsp;plug it into x<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>
<p><br># Error message for invalid inputs<br>&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;Invalid entry!&quot;</p>
<p><br>&nbsp;&nbsp; tries += 1</p>
<p><br>print &quot;\nI guessed it!&nbsp; The number was&quot;, guess<br>print &quot;And it only took me&quot;, tries, &quot;tries!\n&quot;</p>
<div><br>raw_input(&quot;\n\nPress the enter key to exit.&quot;)</div>
<div>####################################################</div>
<div>&nbsp;</div>
<div>I hope this can help you.&nbsp;---- I am&nbsp;newbie, so if&nbsp;I did a mistake I hope you to understand&nbsp;&nbsp;my self &nbsp;;)&nbsp; ---</div><span></span><br clear="all"><br>-- <br>Edgar A. Rodriguez