×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Matthew J_
Added: Jun 22, 2022 12:36 PM
Modified: Jun 22, 2022 1:27 PM
Views: 1
Tags: enum enumerate
  1. list = ["a", "b", "c", "d"]
  2. for index, element in enumerate(list):
  3.     print("Value", element, "Index ", index, )
  4.  
  5. # ('Value', 'a', 'Index ', 0)
  6. # ('Value', 'b', 'Index ', 1)
  7. #('Value', 'c', 'Index ', 2)
  8. # ('Value', 'd', 'Index ', 3)