davea at ieee.org
Thu Jul 9 16:04:23 CEST 2009
You could pick a much better title. And apparently you started a new
thread with this one. When responding to an existing message, you ought
to reply-all to the existing message, rather than starting a new thread.
>> Hello ,
>> When i==0 you append an empty list to arr, so arr[i] is arr. No
>> When i==10 you append another empty list to arr, so arr[i] is arr.
>> Index error because there's no arr, only arr and arr.
>> Thanks for your prompt reply...
>> How can i pass this problem
>> You could try appending to arr[-1] instead.
> Better still:
> row = 
> for j in range(0,1001,1):
> I tried both the ways... the only thing is its not coming like 0 10
> 20.......1000 . Its coming like 0,1,2,........1000.....Any answer to the
> Tanmoy Mukherjee
If you want the row to count by 10's you have to build it that way. You
have the arguments to the ranges backwards. Try:
for i in range(1001):
row = 
for j in range(0,1010,10):
Coincidentally, once you reverse them, the original problem would go
away. But this is better anyway, as it makes it clear what's
happening. You are building 1001 rows, each containing non-contiguous
More information about the Python-list