Roundup Tracker - Issues

Message6397

Author When in trouble, go to the library
Recipients When in trouble, go to the library
Date 2019-03-15.10:40:13
Message-id <1552646413.99.0.967001639169.issue2551031@roundup.psfhosted.org>
In-reply-to
def mach_n(f,n):
    if n <= 0:
        return
    else:
        f
        mach_n(f,n-1)

REMOVE WILD CARDS INTO COMMENTS AS TO NOT DISTURB THE CODE

# f = beliebige_funktion  wild card for any function f

#define function f here
    

#Test

f=print_doof()

def print_doof():
	print('doof')


mach_n(f,6)

RUN MODULE

 RESTART: C:\Users\Henrike
Schwenn\Roaming\Programs\Python\Python36\eigene Funktionen\rekursive
Funktionen\mach_n mit Funktionsobjekt.py 
Traceback (most recent call last):
  File "C:\Users\Henrike Schwenn\Roaming\Programs\Python\Python36\eigene
Funktionen\rekursive Funktionen\mach_n mit Funktionsobjekt.py", line 20,
in <module>
    f=print_doof()
NameError: name 'print_doof' is not defined
>>> 

TYPE: SYNTAX
History
Date User Action Args
2019-03-15 10:40:13When in trouble, go to the librarysetmessageid: <1552646413.99.0.967001639169.issue2551031@roundup.psfhosted.org>
2019-03-15 10:40:13When in trouble, go to the librarysetrecipients: + When in trouble, go to the library
2019-03-15 10:40:13When in trouble, go to the librarylinkissue2551031 messages
2019-03-15 10:40:13When in trouble, go to the librarycreate