>>> from collections import namedtuple >>> Point = namedtuple('Point', ['x', 'y']) #Defining the namedtuple >>> p = Point(10, y=20) #Creating an object >>> p Point(x=10, y=20) >>> p.x + p.y 30 >>> p[0] + p[1] #Accessing the values in normal way 30 >>> x, y = p #Unpacking the tuple >>> x 10 >>> y 20