<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div id="yiv2006461728">Hello all,<br><br>I have started to learn Python a few months ago and I'm loving it! <br>I
am creating a mini-game - the one that scrambles an English word and
asks you what the originalword should be, e.g. yhptno ---&gt; python <br><br>So,
I have a function called get_word() that does the random word thing and
returns two things - 1) original word and 2) scrambled word, namely
"originalword" and "jumble" respectively.&nbsp; So every time I run the
get_word() function, it gives me a new word.&nbsp; <br><br>The code is: <br><br>jumble = get_word()[0]<br>originalword = get_word()[1]<br>print (jumble)<br>answer = input ("What do you think this word is? ")<br>while answer != originalword:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; answer = input ("No! Guess again please.")<br>print ("\nThat's right! The word
 is",originalword)<br><br>The
while loop keeps running until the user guesses the right answer and it
will display the original word.&nbsp; The thing is when it shows the
original word, it has in fact become a new word since the "get_word()"
function has been run again and returned a new word.&nbsp; Does anyone know
how to solve this problem ? I hope it is not too confusing...<br><br>-Ray<br></div></td></tr></table><br>
      



      <hr size=1>Yahoo!香港提供網上安全攻略,教你如何防範黑客!<a href="http://hk.promo.yahoo.com/security/"><b>了解更多</b></a>