Advertisement
Guest User

Playing around with lists and tuple unpacking

a guest
Dec 10th, 2015
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. >>> xs = list(range(10))
  2. >>> list(xs)
  3. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  4. >>> zero_one = xs[:2]
  5. >>> zero_one
  6. [0, 1]
  7. >>> zero, one = zero_one
  8. >>> zero
  9. 0
  10. >>> one
  11. 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement