Using Named Tuples To Store Data

Want to learn more? I recommend these Python books: Python for Data Analysis, Python Data Science Handbook, and Introduction to Machine Learning with Python.

Preliminaries

from collections import namedtuple

Create A Named Tuple

Vehicle = namedtuple('Vehicle', 'make model wheels manual')

Create An Entry

forrester = Vehicle('Forrester', 'Subaru', 4, True)

View The Data In Entry

forrester.model
'Subaru'
forrester.wheels
4