count items in list python by loop

Solutions on MaxInterview for count items in list python by loop by the best coders in the world

showing results for - "count items in list python by loop"
Annaelle
27 Jan 2019
1...
2count = 0
3for item in animals:
4    count = count + 1
5    ...
6
Roberta
05 Jan 2021
1for count, item in enumerate(animals):
2    print("Animal number", count + 1, "in the list is", item)
3
Elisa
19 Jun 2018
1count = 0
2