In this Python program, we will learn how to get the length of a given string. We will find the length of the string using the loop and by using a python built-in function len()
.
Here is the source code of the program to get the length of a given string in Python.
Enter a string: Tutorialsrack.com is an online learning website
Length of the input string is: 47
Enter a string: Program 1: Python program to calculate length of a String without using len() function
Length of the input string is: 86
Program to find the length of string using built-in function len()
Enter a string: Program 1: Python program to calculate length of a String without using len() function
Length of the input string is: 86
Enter a string: counter variable to count the character in a string
Length of the input string is: 51
Comments