<filename>src/examples_in_my_book/general_problems/tuples/namedtuple_example.py
#!/usr/bin/python3
# <NAME> @2013
# steinkirch at gmail

from collections import namedtuple

def  namedtuple_example():
    ''' show some examples for namedtuple '''
    sunnydale = namedtuple('name', ['job', 'age'])
    buffy = sunnydale('slayer', '17')
    print(buffy.job)


if __name__ == '__main__':
    namedtuple_example()



<filename>src/examples_in_my_book/general_problems/tuples/namedtuple_example.py
#!/usr/bin/python3
# <NAME> @2013
# steinkirch at gmail

from collections import namedtuple

def  namedtuple_example():
    ''' show some examples for namedtuple '''
    sunnydale = namedtuple('name', ['job', 'age'])
    buffy = sunnydale('slayer', '17')
    print(buffy.job)


if __name__ == '__main__':
    namedtuple_example()



#!/usr/bin/python3 # <NAME> @2013 # steinkirch at gmail show some examples for namedtuple