Last active
October 26, 2015 09:09
-
-
Save mu-777/5b4064c4e18feba6e7a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
Point = namedtuple('Point3d', 'x y z') | |
point = Point(10,20,30) | |
>>> point | |
Point3d(x=10, y=20, z=30) | |
>>> print point.x, point.y, point.z | |
10 20 30 | |
>>> print point[0], point[1], point[2] | |
10 20 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment