+ 1
How enumerate function works?
enumerate (value,start=index value)
6 Antworten
+ 5
Amit Joe ,
here is a sample of how enumerate can be used:
https://code.sololearn.com/ccLhuM7TZT93/?ref=app
+ 4
value there is a iterator. So it's value, is indexed sequentially from start index.
For ex:
value = [ 'a', 'b', 'c', 'd' ]
for i, j in enumerate(value, start=1) :
print(i, ':', j)
This prints :
1 : 'a'
2 : 'b'
3 : 'c'
4 : 'd'
+ 4
Yes. It is useful to get indexed iterators, so you can make like a mapping. If you don't put start value, the default start value is 0.
+ 2
so start only change the index value not element
+ 1
ok
+ 1
thanks i understand where and how to use enumerate thanks