Created
April 17, 2018 03:02
-
-
Save liudong/3bca33ab1c5dcd746318e1d197eb9f11 to your computer and use it in GitHub Desktop.
Python: namedtuple
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 | |
Animal = namedtuple('Animal', 'name age type') | |
big_yellow = Animal(name="big_yellow", age=3, type="dog") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment