Python String Length
String Length
To get the length of a string, use the len()
function.
ExampleGet your own Python Server
The len()
function returns the length of a string:
a = "Hello, World!"
print(len(a))
Try it Yourself »