Advertisement
here2share

# append_trick.py

Nov 9th, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.10 KB | None | 0 0
  1. # append_trick.py
  2.  
  3. foo = []
  4. bar = foo.append
  5. bar(1)
  6. bar(2)
  7. bar(3) # foo is now [1,2,3]
  8.  
  9. print foo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement