0
Change the code to output squares of the list
def calc(list):ï»ż if len(list)==0:ï»ż return 0ï»ż else:ï»ż return list[0] + calc(list[1:]) ï»ż ï»ż list = [1, 3, 4,
2 Answers
+ 1
Bitu Kumar Sha
This might help, but doesn't use recursion which I think you were trying to implement in your code
def squares(x):
return [i**2 for i in x]
lst = [1,3,4]
print(squares(lst))
0
Bitu Kumar Sha
Can you post your code in the body of the question, not the headings.
As it stands, your question is too disjointed for us to help effectively