Re: for loop without variable

2008-01-09 Thread erik gartz
On Jan 9, 8:35 pm, Dan Sommers <[EMAIL PROTECTED]> wrote: > On Wed, 09 Jan 2008 14:25:36 -0800, erik gartz wrote: > > Hi. I'd like to be able to write a loop such as: > > for i in range(10): > > pass > > but without the i variable. The reason for this is

for loop without variable

2008-01-09 Thread erik gartz
Hi. I'd like to be able to write a loop such as: for i in range(10): pass but without the i variable. The reason for this is I'm using pylint and it complains about the unused variable i. I can achieve the above with more lines of code like: i = 0 while (i != 10): i += 1 Is there a concise

beginner question about range with list and list

2006-11-23 Thread erik gartz
Hello, I'm new to python and I'm having difficulty understanding the following code. Why doesn't the variable a contain [[{}, {'x': 0}, {}], [{}, {'x': 1}, {}]] instead. Doesn't {} allocate new memory for the dictionary each time? It almost appears as if the 2nd dictionary created overwrites the f