9. Figure out the problem with following code that may occur when it is run ?
9. Figure out the problem with following code that may occur when it is run ? Read More »
# Checkpoint 6.1 (b) def recur(p): if p == 0: print(“##”) else: recur(p) p = p-1 recur(5) # The above code will run into infinite recursion because the value of p is being decremented after the recursion call. So it is never actually changing. The correct way: def recur(p): if p == 0: print(“##”) else: