Created
July 19, 2020 17:11
-
-
Save kshirsagarsiddharth/edf7880324a9d1b9223a6de39e979764 to your computer and use it in GitHub Desktop.
immutable named tuples
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 | |
| animal = namedtuple('animal',['species_name','legs_no','color']) | |
| dog = animal('canine',4,'white') | |
| dog.legs_no = 78 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment