How to enumerate a sequence of strings start with 0 in Python

1 Answer

0 votes
sq = ['c', 'c++', 'python', 'java']

lst = list(enumerate(sq))

print(lst)


'''
run:

[(0, 'c'), (1, 'c++'), (2, 'python'), (3, 'java')]

'''

 



answered Jul 1, 2018 by avibootz
edited Jun 9, 2025 by avibootz
...