mirror of
https://github.com/rasbt/python_reference.git
synced 2024-11-27 22:11:13 +00:00
6 lines
163 B
Python
6 lines
163 B
Python
from collections import namedtuple
|
|
|
|
my_namedtuple = namedtuple('field_name', ['x', 'y', 'z', 'bla', 'blub'])
|
|
p = my_namedtuple(1, 2, 3, 4, 5)
|
|
print(p.x, p.y, p.z)
|