On 08/16/2011 01:46 PM, Peter Otten wrote:
Jeff Peters wrote:
Hi;
I am trying to run a function inside a continuing loop, but do not seem
to be able to pass any parameters (arguments ) when I do so.
I have placed working and non-working code , with output below.
## This works:
def loop(fn ):
>def loop(fn ):
> for i in range(5):
> fn( )
>
>def this_function(a=" i am not a string"):
> print( a )
>
>loop(this_function("I am a string") ) ## note the only change is here
>
>## With this as output:
>
> >>>
>I am a string
>Traceback (most recent call last):
> File "/home/je
Jeff Peters wrote:
> Hi;
>
> I am trying to run a function inside a continuing loop, but do not seem
> to be able to pass any parameters (arguments ) when I do so.
> I have placed working and non-working code , with output below.
>
> ## This works:
>
> def loop(fn ):
> for i in range(5):
>
On Tue, Aug 16, 2011 at 1:44 PM, Jeff Peters wrote:
> Hi;
>
> I am trying to run a function inside a continuing loop, but do not seem to
> be able to pass any parameters (arguments ) when I do so.
> I have placed working and non-working code , with output below.
>
> ## This works:
>
> def loop(fn
Hi;
I am trying to run a function inside a continuing loop, but do not seem
to be able to pass any parameters (arguments ) when I do so.
I have placed working and non-working code , with output below.
## This works:
def loop(fn ):
for i in range(5):
fn( )
def this_function(a=" i