Message6409
REVISING HYPOTHESIS THAT THE ERROR MUST BE LOCATED IN THE LAST LINE OF
THE BODY
mach_n(f,n-1)
COMPILER COULD JUST HAVE EXECUTED f
APPROACH:
COMPARE
def mach_n(f,n):
if n <= 0:
return
else:
f
mach_n(f,n-1)
TO ITS MODEL
def print_n(s,n):
if n <=0:
return
print (s)
print_n(s,n-1)
BY DOWNEY WHICH WORKS. IS THERE A DIFFERENCE WITHIN THE RESPECTIVE CODE?
ANSWER: THERE IS NO else: IN def print_n(s,n):, THE CODE FOR n > 0 IS
INDENTED LIKE else: WOULD HAVE BEEN, EXACTLY BELOW if
-> NEXT STEP:
ERASE else: IN def mach_n(f,n):
INDENT f
mach_n(f,n-1)
LIKE print (s)
print_n(s,n-1)IN def print_n(s,n): |
|
Date |
User |
Action |
Args |
2019-03-22 11:04:36 | When in trouble, go to the library | set | messageid: <1553252676.79.0.946929221855.issue2551031@roundup.psfhosted.org> |
2019-03-22 11:04:36 | When in trouble, go to the library | set | recipients:
+ When in trouble, go to the library |
2019-03-22 11:04:36 | When in trouble, go to the library | link | issue2551031 messages |
2019-03-22 11:04:36 | When in trouble, go to the library | create | |
|