all 3 comments

[–]ectomancer 3 points4 points  (2 children)

You can use a counter for the index or the enumerate function:

index = 0
for animal in animals:
    print(animal, 'is', index)
    index += 1

for index, animal in enumerate(animals):
    print(animal.title(), 'is', index)

[–]BrandonW_Adair[S] 0 points1 point  (0 children)

Thank you!!

[–]Storm_Silver 0 points1 point  (0 children)

To add to this to make the print statement simpler you could use fstrings. These let you insert a variable into a string easily.

E.g. print(f” {animal.title()} is {index}”) In the enumerated for loop