string acharacters count in python without using len

Solutions on MaxInterview for string acharacters count in python without using len by the best coders in the world

showing results for - "string acharacters count in python without using len"
Lennard
29 Sep 2019
1# User inputs the string and it gets stored in variable str
2str = input("Enter a string: ")
3
4# counter variable to count the character in a string
5counter = 0
6for s in str:
7      counter = counter+1
8print("Length of the input string is:", counter)