Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

string acharacters count in python without using len

# 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)
Source by beginnersbook.com #
 
PREVIOUS NEXT
Tagged: #string #acharacters #count #python #len
ADD COMMENT
Topic
Name
1+3 =