Answer the question
In order to leave comments, you need to log in
What is the scope of l?
There is a code
def f(x,l=[]):
for i in range(x):
l.append(i)
print(l)
f(3)
f(4)
[0, 1, 2]
[0, 1, 2, 0, 1, 2, 3]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question