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