I am trying to get indexes for adams
and lewis
from a list.
Presidents = ['washington','adams','jeff','lewis']
def index():
for index,name in enumerate(Presidents):
if name == 'adams':
return index
print(index())
How can I modify this function? So that when the function index()
is called, it should return the index of adams
and lewis
as integers.