len() function is an inbuilt function in Python programming language that returns the length of the string.
It takes string as the parameter.
It returns an integer which is the length of the string.
Below is the Python implementation of the len() method.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python String Methods | Set 2 (len, count, center, ljust, rjust, isalpha, isalnum, isspace & join)
- List Methods in Python | Set 1 (in, not in, len(), min(), max()...)
- Dictionary Methods in Python | Set 1 (cmp(), len(), items()...)
- Write your own len() in Python
- Python | Pandas Series.str.len()
- Internal Working of the len() Function in Python
- Python - Length of shortest string in string list
- Python program to print even length words in a string
- Find length of a string in python (4 ways)
- Python | Generate random string of given length
- Python | Padding a string upto fixed length
- Python | Extract length of longest string in list
- Python | Average String length in list
- Python - Smallest Length String
- Python | Extract odd length words in String
- Python - Dictionary values String Length Summation
- Python - Maximum String value length of Key
- Python - Custom length tuples from String
- Python - Remove K length Duplicates from String
- Python - Avoid Spaces in string length
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.