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 Réponses
+ 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