#!/usr/bin/env python # -*- coding: utf-8 -*- from collections import namedtuple ChemEl = namedtuple('Element', 'name atomic_number symbol group period atomic_weight') # same as defining a class for elements hydrogen = ChemEl('hydrogen', 1, 'H', 1, 1, 1.008) helium = ChemEl('helium', 2, 'He', 18, 1, 4.002602) print(hydrogen.atomic_weight) print(hydrogen.symbol) print(hydrogen, type(hydrogen)) print(helium)