rfmonk

collections_tuple.py

Jan 10th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. bob = ('Bob', 30, 'male')
  5. print 'Representation:', bob
  6.  
  7. jane = ('Jane', 29, 'female')
  8. print '\nField by index:', jane[0]
  9.  
  10. print '\nFields by index:'
  11. for p in [bob, jane]:
  12.     print '%s is a %d year old %s' % p
Advertisement
Add Comment
Please, Sign In to add comment