L
lallous
Hello
What is faster when clearing a list?
del L[:]
or
L = []
What is faster when clearing a list?
del L[:]
or
L = []
lallous said:Hello
What is faster when clearing a list?
del L[:]
or
L = []
Hello
What is faster when clearing a list?
del L[:]
or
L = []
[] []x = range(5)
x = y
print x, y [1, 2, 3, 4] [1, 2, 3, 4]
x = []
print x, y [] [1, 2, 3, 4]
x = y
print x, y [1, 2, 3, 4] [1, 2, 3, 4]
del x[:]
print x, y
Hello
What is faster when clearing a list?
del L[:]
or
L = []
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.