Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. >>> d = dict(zip(['key1', 'key2'], [[]]*2))
  2. >>> d
  3. {'key2': [], 'key1': []}
  4. >>> d['key1'].append(1)
  5. >>> d
  6. {'key2': [1], 'key1': [1]}
  7. >>> d = dict(zip(['key1', 'key2'], [[], []]))
  8. >>> d
  9. {'key2': [], 'key1': []}
  10. >>> d['key1'].append(1)
  11. >>> d
  12. {'key2': [], 'key1': [1]}
  13. >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement