[Tutor] memory consumption

Andre' Walker-Loud walksloud at gmail.com
Thu Jul 4 00:11:03 CEST 2013


Hi Alan,

>>>> # loop over parameters and fill array with desired output
>>>> for i in range(loop_1):
>>>>     for j in range(loop_2):
>>>>         for k in range(loop_3):
>>> 
>>> How big are loop_1, loop_2, loop_3?
>> 
>> The sizes of the loops are not big
>> len(loop_1) = 20
>> len(loop_2) = 10
>> len(loop_3) = 10
> 
> This is confusing.
> The fact that you are getting values for the len() of these
> variables suggests they are some kind of collection? But you
> are using them in range which expects number(s)

Yes, I was being sloppy.  My later post clarified what I meant.
The loops are really lists, and I was really using enumerate() to get both the iter and the element.

loop_2 = [1,2,4,8,16,32,64,128,256,512,1024]
for i,n in enumerate(loop_2):
   ...


Thanks,

Andre




More information about the Tutor mailing list