<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
>>> def randnum():<br>
... c = []<br>
... for x in range(6):<br>
... s = random.randrange(50)<br>
... c.append(s)<br>
... print 'Randoms: ',c<br>
... c = []<br>
<br>
<br>
This works good !!<br>
<br>
Johan<br>
<br>
R. Alan Monroe wrote:
<blockquote cite="mid155744839041.20051027222309@columbus.rr.com"
type="cite">
<blockquote type="cite">
<pre wrap="">Hey all,
I am trying to create a program that draws 6 numbers between 1 and 49 at random for creating lottery tickets. I want to have a better chance when I play. Can anyone help me code this or show me how
to, please?
</pre>
</blockquote>
<pre wrap=""><!---->
Create (empty for now) list to hold your final numbers.
Have a for-loop that runs 6 times using range(6)
Inside the loop, just pick a random number and append it to your final
number list.
Alan
_______________________________________________
Tutor maillist - <a class="moz-txt-link-abbreviated" href="mailto:Tutor@python.org">Tutor@python.org</a>
<a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a>
</pre>
</blockquote>
</body>
</html>