Python NamedTuple Example

Python

 1|  from collections import namedtuple
 2|  
 3|  team = namedtuple('Team','league league_position')
 4|  arsenal = team('Premier League', 7)
 5|  print(arsenal.league)
Did you find this snippet useful?

Sign up for free to to add this to your code library