Write a Python Program to find a String Length with practical examples.
Python Program to find a String Length
The program finds the string length using the len function.
Please refer String article to understand everything about them in Python.
str1 = "Tutorial Gateway" print("Total Length of a Given String = ", len(str1))
Total Length of a Given String = 16
Example 2
This python program is the same as the first example. However, this time, we are allowing the user to enter their own string.
str1 = input("Please enter your own String : ") print("Total Length of a Given String = ", len(str1))
