This method will return the number of elements in the list or length of string depending on the argument passed. Though we do not need to write it in python for data science but we must know atleast.
Implementing without using len():
Python implementation:
So, to learn more about it in python for data science, you can check this and this as well.