Last active
July 18, 2020 16:58
-
-
Save kshirsagarsiddharth/399ec65f520d5685117206b5ae403c77 to your computer and use it in GitHub Desktop.
defining named tuple
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 | |
| 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