Light Mode
Dark Mode
Coding Tip: Replacing a list without loosing link
my_list = [1,2,3]

def replace_list(ll):
    ll[:] = [4,5,6]

replace_list(my_list)
print(my_list)
  • python
  • tips
Created: Dec. 18, 2017, 12:56 p.m.
Updated: Jan. 6, 2018, 8:56 p.m.
0
40
User avatar
oduvan