questions about functions inside a function

Wildemar Wildenburger wildemar at freakmail.de
Mon Jul 16 08:31:16 EDT 2007


Wildemar Wildenburger wrote:
>> for f in a:
>>      print f()
>> 0
>> 1
>> 4
>> 9
>>
>> How to achieve this?
>>
>> Thanks a lot!
>>
>>   
>>     
> I fail to see the point, sorry. Why would you want that? If you simply 
> want a list of values you do:
>
>   
>>>> a = [i**2 for i in range(4)]
>>>>         
>
> Can you elaborarate on what it is you really want.
>
> /W
>   

Sorry, I'm an idiot. Nevermind. :-/

/W



More information about the Python-list mailing list