Hello Jon,<br><br>Why don't use randint so you can record the index and the value <br><br>Example:<br>&nbsp;&nbsp;&nbsp; WORDS = (&quot;python&quot;, &quot;program&quot;, &quot;code&quot;, &quot;xylophone&quot;)<br>&nbsp;&nbsp;&nbsp; Indword = random.randint
(0,len(WORDS)-1)<br>&nbsp;&nbsp;&nbsp; word = WORDS[Indword]<br>&nbsp;&nbsp;&nbsp; print Indword<br>&nbsp;&nbsp;&nbsp; print word<br><br>Cheers,<br>pujo<br><br><div><span class="gmail_quote">On 1/19/06, <b class="gmail_sendername">Jon Moore</b> &lt;<a href="mailto:jonathan.r.moore@gmail.com">
jonathan.r.moore@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello<br><br>I need some help for a program I am writing as a newbie to Python.
<br><br>I have created a series:<br><br><span style="font-weight: bold;">WORDS = (&quot;python&quot;, &quot;program&quot;, &quot;code&quot;, &quot;xylophone&quot;)
</span><br><br>and then assigned one of them randomly to the variable 'word':<br><br><span style="font-weight: bold;">word = random.choice(WORDS)</span><br><br>I know that if I do:<br><br><span style="font-weight: bold;">

print word</span><br><br>The randomly chosen word will be displayed. I also know that if I type:<br><br><span style="font-weight: bold;">print WORDS[x]</span><br><br>I will get the corresponding word back. But how do I find 'programaticaly' the index number for the string that 
random.choice has chosen?<br><br>The reason I ask is that I an writing a simple word jumble game and need to link the randomly chosen word to a hint should the user need one.<br clear="all"><br>-- <br>Best Regards<br><span class="sg">
<br>
Jon Moore

</span><br>_______________________________________________<br>Tutor maillist &nbsp;- &nbsp;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Tutor@python.org">Tutor@python.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">
http://mail.python.org/mailman/listinfo/tutor</a><br><br><br></blockquote></div><br>