Skip to content

Instantly share code, notes, and snippets.

@liudong
Created April 17, 2018 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liudong/3bca33ab1c5dcd746318e1d197eb9f11 to your computer and use it in GitHub Desktop.
Save liudong/3bca33ab1c5dcd746318e1d197eb9f11 to your computer and use it in GitHub Desktop.
Python: namedtuple
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