+ 6

How to print list using recursion.

this is my code but output is not right. https://code.sololearn.com/c75y6X4djoEC/?ref=app i want full list [1,2,3,4] why it giving me only [2,3,4]

29th Sep 2018, 10:15 AM
Maninder $ingh
Maninder $ingh - avatar
8 odpowiedzi
+ 3
Aadrita thanks for help me but it does not work, never give up.
29th Sep 2018, 4:10 PM
Maninder $ingh
Maninder $ingh - avatar
+ 3
Aadrita oh sorry i forget to add square brackets in last line thanks man.
29th Sep 2018, 4:17 PM
Maninder $ingh
Maninder $ingh - avatar
+ 2
Kevin Dietrichstein it's just experiment.
29th Sep 2018, 3:45 PM
Maninder $ingh
Maninder $ingh - avatar
2nd Oct 2018, 3:37 PM
Maninder $ingh
Maninder $ingh - avatar
0
what are you trying to achieve with this code? just to print it like print([1, 2, 3, 4]) ?
29th Sep 2018, 10:59 AM
Kevin Dietrichstein
Kevin Dietrichstein - avatar
0
def printlist (list,l): if (l>=len(list)): return print(list[l]) return printlist (list,l+1) list=[1,2,3,4,5] printlist (list,0)
30th Sep 2018, 8:55 PM
Muhammad Hashir Mohsneen
0
Muhammad Hashir Mohsneen can you help me out with a problem ?
30th Sep 2018, 9:29 PM
Junie B.
0
Can you please tell me that what to add for solving the question in functions by recursion to print values?
2nd Oct 2018, 9:45 AM
Rachana C