Roundup Tracker - Issues

Message6392

Author When in trouble, go to the library
Recipients When in trouble, go to the library
Date 2019-03-15.10:01:16
Message-id <1552644076.73.0.833831242945.issue2551028@roundup.psfhosted.org>
In-reply-to
DEFINE S BEFORE RUNNING MODULE

'''Um mögliche Fehlerquellen bei mach_n auszuschließen, wird die
Funktion print_n (s,n) von Downey, S.58 unverändert eingegeben.
Diese Funktion gibt einen String n-mal aus.'''

def print_n(s,n):
    if n <=0:
        return
    print (s)
    print_(s,n-1)
    
s='beliebiger_string' #Platzhalter für die Definition von s

print_n(s,n)

RUN MODULE

 RESTART: C:\Users\Henrike
Schwenn\Roaming\Programs\Python\Python36\eigene Funktionen\rekursive
Funktionen\Test print_n(s,n) - Downey S. 58.py 
Traceback (most recent call last):
  File "C:\Users\Henrike Schwenn\Roaming\Programs\Python\Python36\eigene
Funktionen\rekursive Funktionen\Test print_n(s,n) - Downey S. 58.py",
line 12, in <module>
    print_n(s,n)
NameError: name 'n' is not defined

TYPE: SYNTAX
History
Date User Action Args
2019-03-15 10:01:16When in trouble, go to the librarysetmessageid: <1552644076.73.0.833831242945.issue2551028@roundup.psfhosted.org>
2019-03-15 10:01:16When in trouble, go to the librarysetrecipients: + When in trouble, go to the library
2019-03-15 10:01:16When in trouble, go to the librarylinkissue2551028 messages
2019-03-15 10:01:16When in trouble, go to the librarycreate