1.enumerate
sequence=['a','b','c','d']
print(enumerate(sequence))
print(list(enumerate(sequence)))
for i,num in enumerate(sequence):
print(i,num)
----------------------output
<enumerate object at 0x000001F716B09480> #illustrate it returns an object
[(0, 'a'), (1, 'b'), (2, 'c'), (3, 'd')] #convert to a list that can be print,(index,raw_value)
0 a
1 b
2 c
3 d