[Tutor] [Fwd: Re: What is this kind of loop called]
rabidpoobear at gmail.com
Mon Jun 8 06:48:43 CEST 2009
>>> def get(numbers):
>>> print 'Calling ', numbers
>>> print 'Connected '
>>> def call_numbers():
>>> for i in range(9549355543, 9549355560):
>>> numbers = i
>>> Is there a technical name for a loop like this?
>> For loop? That is what I call it.
> As usual I am not very clear, see how the call_numbers() for loop gets
> passes to the get(numbers) to do something else, that is what I was
> asking about.
That part is not considered a loop.
There is a type of programming paradigm called "recursion" that is
similar to loops, perhaps that's what you're thinking of?
if num == 0:
return num + recursive(num - 1)
However your example is not recursion, because the function does not
call itself repeatedly; rather, call_numbers is called once, and then it
repeatedly calls a _different_ function. Savvy the difference?
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4136 (20090606) __________
The message was checked by ESET NOD32 Antivirus.
More information about the Tutor