How to get the length of a string in Python?

PythonServer Side ProgrammingProgramming

Python has a method called len() that gives us the length of any composite object. To get the length of a string, just pass the string to the len() call. For example,

print(len('abcdefghijklmnopqrstuvwxyz'))

OUTPUT

26
raja
Updated on 27-Sep-2019 12:07:57

Advertisements