Write a Python program to find length of the string .using Len()
Answers
Answered by
3
Explanation:
First we will see how to find the length of string without using library function len(). Here we are taking the input from user and counting the number of characters in the input string using for loop.
# User inputs the string and it gets stored in variable str
str = input("Enter a string: ")
# counter variable to count the character in a string
counter = 0
for s in str:
counter = counter+1
print("Length of the input string is:", counter)
Output:
Enter a string: Beginnersbook
Length of the input string is: 13
Answered by
1
Answer:
Explanation:
Len () is used for find the length of the string
Similar questions
Art,
6 months ago
English,
6 months ago
Physics,
1 year ago
Social Sciences,
1 year ago
English,
1 year ago