Hello, Please help me in writing a code to count number of characters in the string, without using the len().
Hi, Uday.
Kindly share the code that you have tried. It will be easy for us to understand your approach. I can give you answers no problem, but you will not learn it.
s=“udaybora”
count=0
for i in s:
count=count+1
print(count)
All the best!
1 Like
I am learning this accumulator pattern and its bit hard for me to bucket it at this moment.
Thank you. The code has worked for me. I was even writing a code a bit similar to the one you have helped me with. I am still learning to initialize, interate and update methodology.
Thanks once again.
1 Like