DEV Community

Discussion on: Many Things You Can Do With Python Lists You May Have Missed

Collapse
 
aumayeung profile image
John Au-Yeung

There's no difference.

Collapse
 
kedark profile image
Kedar Kodgire

I guess there is a huge difference between them

  • count returns the number of occurrences of a particular element in the list
  • length returns the length of the list

check the example below

>>> vowels = ['a', 'e', 'i', 'o', 'i', 'u']
>>> vowels.count('a')
1
>>> len(vowels)
6
Thread Thread
 
aumayeung profile image
John Au-Yeung

Yes. You're right