Python string length | LEN ()



Syntax :

len(string)

Parameters:
It takes a string as a parameter.

Return value:

It returns an integer which is the length of the string.

Below is the implementation of the len () method in Python.

# Python program to demonstrate usage
# len () method

 
# Length lines below 5

string = "geeks " 

print ( len (string))

 
# Line length below 15

string = "geeks for geeks"  

print ( len (string))

Exit :

 5 15