enumerate python
#Enumerate in python
l1 = ['alu','noodles','vada-pav','bhindi']
for index, item in enumerate(l1):
if index %2 == 0:
print(f'jarvin get {item}')
enumerate python
#Enumerate in python
l1 = ['alu','noodles','vada-pav','bhindi']
for index, item in enumerate(l1):
if index %2 == 0:
print(f'jarvin get {item}')
ennumerate python
grocery = ['bread', 'milk', 'butter']
for item in enumerate(grocery):
print(item)
''' output
(0, 'bread')
(1, 'milk')
(2, 'butter')
'''
for count, item in enumerate(grocery):
print(count, item)
''' output
0 bread
1 milk
2 butter
'''
# changing default start value
for count, item in enumerate(grocery, 100):
print(count, item)
''' output
100 bread
101 milk
102 butter
'''
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us