<div>Thanks Adam, that was a typo on my part, in the program the print is actually indented. Any other suggestions?</div>
<div> </div>
<div>Thanks again!</div>
<div>Jeff<br><br><br><br></div>
<div class="gmail_quote">On Wed, Nov 24, 2010 at 5:00 PM, Adam Bark <span dir="ltr"><<a href="mailto:adam.jtm30@gmail.com">adam.jtm30@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div bgcolor="#ffffff" text="#000000">
<div>
<div></div>
<div class="h5">On 24/11/10 21:51, Jeff Goodwin wrote: </div></div>
<blockquote type="cite">
<div>
<div></div>
<div class="h5">
<div>Hello,</div>
<div> </div>
<div>I'm trying to find a way to use the random.randint function to generate a random number, but everytime I run the program it locks up IDLE. Here is what I have so far:</div>
<div> </div>
<div>import random</div>
<div> </div>
<div>def main():</div>
<div> x = input("Enter a number: ")</div>
<div> y = input("Enter a different number: ")</div>
<div> </div>
<div> z = random.randint(x,y)</div>
<div> </div>
<div>print "The random number between ", x, " and ", y, " is ", z</div>
<div> </div>
<div>main()</div>
<div> </div>
<div>Can you tell me where I'm going wrong here? When I run the program it allows me to enter the numbers for x and y, then freezes. </div>
<div><br>Thanks! </div>
<div>Jeff </div>
<div> </div></div></div><pre><fieldset></fieldset>
_______________________________________________
Tutor maillist - <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a>
To unsubscribe or change subscription options:
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a>
</pre></blockquote><tt>Your print statement isn't indented. It should print "the random number between"</tt> and then throw an exception I think. You should either move the print statement into the function or have main return x, y, z and print the return values of it.<br>
<br>HTH.<br></div></blockquote></div><br>