import collections
Person=collections.namedtuple('Person','name age gender')
print( 'Type of Person:',type(Person))
# Type of Person: <class 'type'>
Bob=Person(name='Bob',age=30,gender='male')
print( 'Representation:',Bob)
# Representation: Person(name='Bob', age=30, gender='male')
Jane=Person(name='Jane',age=29,gender='female')
print( 'Field by Name:',Jane.name)
# Field by Name: Jane
for people in [Bob,Jane]:
print ("%s is %d years old %s" % people)
# Bob is 30 years old male
# Jane is 29 years old female