Roundup Tracker - Issues

Message6396

Author When in trouble, go to the library
Recipients When in trouble, go to the library
Date 2019-03-15.10:36:17
Message-id <1552646177.24.0.240662455217.issue2551031@roundup.psfhosted.org>
In-reply-to
'''Funktion soll
    Funktionsobjekt f und Zahl n als Argumente entgegennehmen
    das Funktionsobjekt n-mal hintereinander ausführen'''


def mach_n(f,n):
    if n <= 0:
        return
    else:
        f
        mach_n(f,n-1)

f = beliebige_funktion # wild card for any function f

def beliebige_funktion(): #define function f here
    Body

#Test

f=print_doof()

def print_doof():
	print('doof')

RUN MODULE

mach_n(f,6) 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 13,
in <module>
    f = beliebige_funktion # wild card for any function f
NameError: name 'beliebige_funktion' is not defined
>>> 

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