[Tutor] Question about login=''.join(choice(lc) for j in range(llen))

2012-04-03 Thread Khalid Al-Ghamdi
Hi, The following code tries to generate some dummy data for regex exercises. My question is in reference the line before last: dom=.join(choice(lc) for j in range (dlen)) how does the interpreter know what j is supposed to refer to when it was not mentioned prior? from random import

Re: [Tutor] Question about login=''.join(choice(lc) for j in range(llen))

2012-04-03 Thread Emile van Sebille
On 4/3/2012 7:54 AM Khalid Al-Ghamdi said... Hi, The following code tries to generate some dummy data for regex exercises. My question is in reference the line before last: dom=.join(choice(lc) for j in range (dlen)) how does the interpreter know what j is supposed to refer to when it

Re: [Tutor] Question about login=''.join(choice(lc) for j in range(llen))

2012-04-03 Thread Alan Gauld
On 03/04/12 15:54, Khalid Al-Ghamdi wrote: dom=.join(choice(lc) for j in range (dlen)) how does the interpreter know what j is supposed to refer to when it was not mentioned prior? In Python variables are defined by using them. In the code below you have i used in a for loop, even

Re: [Tutor] Question about login=''.join(choice(lc) for j in range(llen))

2012-04-03 Thread Peter Otten
Alan Gauld wrote: On 03/04/12 15:54, Khalid Al-Ghamdi wrote: dom=.join(choice(lc) for j in range (dlen)) how does the interpreter know what j is supposed to refer to when it was not mentioned prior? In Python variables are defined by using them. In the code below you have i used

Re: [Tutor] Question about login=''.join(choice(lc) for j in range(llen))

2012-04-03 Thread wesley chun
On Tue, Apr 3, 2012 at 10:50 AM, Peter Otten __pete...@web.de wrote: Alan Gauld wrote: On 03/04/12 15:54, Khalid Al-Ghamdi wrote:      dom=.join(choice(lc) for j in range (dlen)) how does the interpreter know what j is supposed to refer to when it was not mentioned prior? +1 everyone