How to count the number of items in a list in Python

preview_player
Показать описание


Code from video:
*****************
company = ['michael', 'eric', 'michael']
import collections
collections.Counter(company)

Connect with us!
*****************
Рекомендации по теме
Комментарии
Автор

Thanks Man! I just got the exercise for this!

muhamadrifai
Автор

Okay but like what if i want it to tell me how MANY elements. I want 3 to be the output. WHy is it so hard to find the answer to that. Everyone is showing me how to count repeats and i don't NEED that

emmalea
Автор

I have several values in my list and i wanted an instruction on how to count how many values i had in the list total. this doesnt count the number of items in a list. This counts the number of DIFFERENT items in a list.

Misdom
Автор

Is there anyway to code this without the count function?

thomasposch
Автор

how to count the number of all elements in a list?

KING-zzqt