+ 1

What does this code output:

def f(x,l=[]): for i in range(x): l.append(i*i) print(l) f(2) f(3,[3,2,1]) f(3)

14th Jul 2018, 6:10 PM
Mayur Shetty
Mayur Shetty - avatar
5 Answers
+ 1
Mayur Shetty f(2) = [0,1] f(3,[3,2,1]) = [3,2,1,0,1,4] f(3) = [0,1,4] Note:: I may have answered your question, but it's not appropriate to post such questions on Q&A forum. This is a place for programming questions, not quizzes
14th Jul 2018, 6:22 PM
Dlite
Dlite - avatar
0
f(2)=[0, 1] f(3,[3,2,1])=[3, 2, 1, 0, 1, 4] f(3)=[0, 1, 0, 1, 4]
14th Jul 2018, 6:30 PM
Mayur Shetty
Mayur Shetty - avatar
0
What does this code output?
11th Mar 2021, 2:56 PM
daoudi mohamed ali
0
What does this code output? Print (1+2+3)
19th May 2022, 3:54 AM
Jhabari Cole
0
What does this code output?
9th Mar 2023, 12:08 PM
Raimov Akbarjon
Raimov Akbarjon - avatar