To find length of any string in python, you have to ask from user to enter any string and then find the length of that string using the len() function as shown in the program given below.
Following python program ask from user to enter a string and find the length of that string:
# Python Program - Find Length of String while True: print("Enter 'x' for exit.") string = input("Enter string: ") if string == 'x': break else: print("Length of string =", len(string),"\n")
Here is the sample run of the above Python program:
You may also like to learn or practice the same program in other popular programming languages: