Re: [Tutor] FW: (no subject)

2012-12-02 Thread Luke Paireepinart
On Sun, Dec 2, 2012 at 8:41 PM, Ashfaq wrote: > Luke, > > Thanks. The generator syntax is really cool. > I misspoke, the correct term is "list comprehension". A generator is something totally different! Sorry about the confusion, my fault. I type too fast sometimes :) Glad you liked it though

Re: [Tutor] FW: (no subject)

2012-12-02 Thread Ashfaq
Luke, Thanks. The generator syntax is really cool. -- Ashfaq ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] FW: (no subject)

2012-12-01 Thread Luke Paireepinart
Ashfaq, On Sat, Dec 1, 2012 at 10:46 AM, Ashfaq wrote: > Run your code 10,000 times. :) > > > ** ** >> >> import math >> >> import random >> >> random.seed() >> >> > there is no need to call seed() with no parameters. From the docs: """ If *x* is omitted or None, current system tim

Re: [Tutor] FW: (no subject)

2012-12-01 Thread Ashfaq
Run your code 10,000 times. :) ** ** > > import math > > import random > > random.seed() > > points = [] for i in range(0, 1): x=random.uniform(0,1) y=random.uniform(0,1) points.append ( (x, y) ) I hope it helps. -- Sincerely, Ashfaq

Re: [Tutor] FW: (no subject)

2012-11-30 Thread Ed Owens
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 p

Re: [Tutor] FW: (no subject)

2012-11-30 Thread Albert-Jan Roskam
>> 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, > >What red? I see no red. > >Please do not rely on colour in email, for at least two reasons: > >1) For

Re: [Tutor] FW: (no subject)

2012-11-30 Thread Steven D'Aprano
Hello Tara, or is it Leon? On 30/11/12 20:21, leon zaat wrote: 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, What red? I see no red. Please do not rely on

[Tutor] FW: (no subject)

2012-11-30 Thread leon zaat
From: tara.nichol...@live.co.uk To: tutor@python.org Date: Tue, 20 Nov 2012 14:39:06 + 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