1>>> values = ["a","b","c"]
2>>> for count, value in enumerate(values):
3... print(count, value)
4...
50 a
61 b
72 c
8
1>>> for count, value in enumerate(values):
2... print(count, value)
3...
40 a
51 b
62 c
7
1for index,subj in enumerate(subjects):
2 print(index,subj) ## enumerate will fetch the index
3
40 Statistics
51 Artificial intelligence
62 Biology
73 Commerce
84 Science
95 Maths
1for index,char in enumerate("abcdef"):
2 print("{}-->{}".format(index,char))
3
40-->a
51-->b
62-->c
73-->d
84-->e
95-->f
1>>> frutas = ["manzanas", "peras", "naranjas"]
2>>> for i, fruta in enumerate(frutas):
3... print(i, fruta)
40 manzanas
51 peras
62 naranjas
1for key, value in enumerate(["p", "y", "t", "h", "o", "n"]):
2 print key, value
3
4"""
50 p
61 y
72 t
83 h
94 o
105 n
11"""
12