enumerate() function: What will the output of the following function be?

Code:

names = ['Rachel', 'Monica', 'Phoebe']
print(list(enumerate(names, start = -1)))
  • [(-1, 'Rachel'), (0, 'Monica'), (1, 'Phoebe')]
  • [(1, 'Rachel'), (-1, 'Monica'), (0, 'Phoebe')]
  • [(-1, 'Monica'), (0, 'Phoebe'), (1, 'Rachel')]
  • Error

enumerate() returns a tuple containing a count (from start which defaults to 0) and the values obtained from iterating over iterable. 

Comments