Computer Science, asked by tanishduggal09, 7 months ago

explain the difference between len() and count() function of list?

Answers

Answered by shivanibhatnagar60
1

Answer:

Counts the number of elements in this iterator. So while they return the same value, count will actually count the elements. Note that len is available only for ExactSizeIterator; so if the value is lazy-retrieved the total length may not be available and you need to explicitly count it.

Answered by vandana929011
1

Answer:

1. len() :- This function returns the length of the string

. 2. count(“string”, beg, end) :- This function counts the occurrence of mentioned substring in whole string.

Similar questions