How to remove the last "add -->" from the output when using end, i am not using sep here, bcoz sep will not have any effect here , as the print statement prints just 1 item at a time here and ends with incr of i
def fibonaci_num(n):
if n <= 1:
return n
else:
return fibonaci_num(n-1) + fibonaci_num(n-2)
N = 10
for i in range(N):
print(fibonaci_num(i), end=' add -> ')
my output
0 add -> 1 add -> 1 add -> 2 add -> 3 add -> 5 add -> 8 add -> 13 add -> 21 add -> 34 add ->