[Tutor] memory consumption

Alan Gauld alan.gauld at btinternet.com
Thu Jul 4 00:03:37 CEST 2013


On 03/07/13 20:50, Andre' Walker-Loud wrote:

>>> # 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)

What kind of things are loop_1 etc?
What happens at the >>> prompt if you try to
 >>> print range(loop_1)

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list