<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
import random&nbsp; 
print("\tWelcome to 'Guess My Number'!")<BR>print("I'm thinking of a number between 1 and 100.")<BR>print("Try to guess it in as few attempts as possible.\n")<BR>
# set the initial values<BR>the_number = random.randint(1, 100)<BR>guess = int(input("Take a guess: "))<BR>tries = 1<BR>
# guessing loop<BR>while guess != the_number:<BR>&nbsp;&nbsp;&nbsp; if guess &gt; the_number:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print("Lower...")<BR>&nbsp;&nbsp;&nbsp; else:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print("Higher...")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; guess = int(input("Take a guess: "))<BR>&nbsp;&nbsp;&nbsp; tries = tries + 1<BR>
print("You guessed it!&nbsp; The number was", the_number)<BR>print("And it only took you", tries, "tries!\n")<BR>&nbsp; <BR>input("\n\nPress the enter key to exit.")<BR><BR>*******************************************************************<BR>can anyone explain the <STRONG><U>tries</U></STRONG> part&nbsp;of this programme to me i know its meant to count&nbsp;the number of&nbsp;guesses made by the user&nbsp;by adding 1 but i just cant figure out how it does this..........can someone explain??&nbsp; i.e. tries = 1, tries +1&nbsp;etc.... cant get my head around it...<BR>
&nbsp;<BR>
thanks all<BR>&nbsp;<BR><FONT size=3><FONT color=#000000><FONT face="Times New Roman">&nbsp;</FONT></FONT></FONT><FONT size=3><FONT color=#000000><FONT face="Times New Roman"> </FONT></FONT></FONT><BR>Adrian Kelly <BR>1 Bramble Close<BR>Baylough<BR>Athlone<BR>County Westmeath<BR><BR>0879495663<BR><BR>                                               </div></body>
</html>