Python: Enumeration Over Tuple
Posted: Tue Apr 07, 2026 5:46 pm
Code: Select all
tuple_of_some_NFL_teams = tuple(("Washington Commanders", "Dallas Cowboys", "Miami Dolphins"))
for i, team_name_value in enumerate(tuple_of_some_NFL_teams):
print(f "Index {i}: {team_name_value}")
# prints index and associated value