Skip to content

Instantly share code, notes, and snippets.

@fatosmorina
Created September 12, 2021 05:33
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 fatosmorina/d1377b77b0b04e02daabeba54eea70b6 to your computer and use it in GitHub Desktop.
Save fatosmorina/d1377b77b0b04e02daabeba54eea70b6 to your computer and use it in GitHub Desktop.
from collections import namedtuple
Day = namedtuple('Day', ['name', 'day_index'])
first_day = Day('Monday', 1)
second_day = Day('Tuesday', 2)
print(first_day.name, first_day.day_index) # Monday 1
print(second_day.name, second_day.day_index) # Tuesday 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment