-
-
Save xyj404/a2dc980e3b7803c4740cc0633a4b9907 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
P=namedtuple('Point',['x','y']) | |
pp=namedtuple('pp',['x','y']) | |
print P.__doc__ | |
p=P(111,222) | |
print p | |
print p.x+p.y | |
print p[0]+p[1] | |
m,n=p | |
print m,n | |
d=p._asdict() | |
print d,d['x'],d['y'] | |
x=pp(**d) | |
print x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a test