How to Get Length of a String in Python


In this example we will show how to get the length of a string using the len() function in Python.

Source Code

my_str = 'Python'

print(len(my_str))

Output:

6
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments