[Tutor] FW: (no subject)
leon zaat
zaatlob at hotmail.com
Fri Nov 30 10:21:21 CET 2012
From: tara.nicholson at live.co.uk
To: tutor at python.org
Date: Tue, 20 Nov 2012 14:39:06 +0000
Subject: [Tutor] (no subject)
Hi, im trying to write a script which randomly generates 10,000 points(x,y) in the unit square(so range between 0 and 1 for both x and y).so far I have written the code below in red, however it only produces one random point. How do I get it to repeat this so it produces 10,000 different random points?Thankyouuu, Tara.
import mathimport randomrandom.seed() x=random.uniform(0,1)y=random.uniform(0,1)
for i in range(0,1): for j in range(0,1): print (x,y)
_______________________________________________
Tutor maillist - Tutor at python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121130/96c4a2dd/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001
URL: <http://mail.python.org/pipermail/tutor/attachments/20121130/96c4a2dd/attachment-0001.ksh>
More information about the Tutor
mailing list