explain the difference between len() and count() function of list?
Answers
Answered by
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
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