Skip to content

Instantly share code, notes, and snippets.

@kshirsagarsiddharth
Last active July 18, 2020 16:58
Show Gist options
  • Select an option

  • Save kshirsagarsiddharth/399ec65f520d5685117206b5ae403c77 to your computer and use it in GitHub Desktop.

Select an option

Save kshirsagarsiddharth/399ec65f520d5685117206b5ae403c77 to your computer and use it in GitHub Desktop.
defining named tuple
from collections import namedtuple
Bevrage = namedtuple('Bevrage',['name','color','type'])
tea = Bevrage('tea','brown','hot')
print(tea.name,tea.color,tea.type)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment