Python string length | len()
len() function is an inbuilt function in Python programming language that returns the length of the string.
Syntax:
len(string)
Parameters:
It takes string as the parameter.
Return Value:
It returns an integer which is the length of the string.
Below is the Python implementation of the len() method.
# Python program to demonstrate the use of# len() method # Length of below string is 5string = "geeks" print(len(string)) # Length of below string is 15string = "geeks for geeks" print(len(string)) |
Output:
5 15


