mirror of
https://github.com/rasbt/python_reference.git
synced 2024-11-30 15:31:12 +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)
|