How to implement without using len ():
1. Take input and pass the string / list into a function which return its length. 2. Initialize a count variable to 0, this count variable count character in the string. 3. Run a loop till length if the string and increment count by 1. 4. When loop is completed return count.
This article provided by Sahil Rajput . If you are as Python.Engineering and would like to contribute, you can also write an article using contribute.python.engineering or by posting an article contribute @ python.engineering. See my article appearing on the Python.Engineering homepage and help other geeks.
Please write in comments if you find anything wrong or if you’d like to share more information on the topic discussed above.