Can anyone tell me how can I get the length of a string without using the len() function or any string methods. Please anyone tell me as I\'m tapping my head ma
a = 'malayalam'
length = 0
for i in a:
if i == "":
break
else:
length+=1
print length
This code verifies the length of a string by counting until ""(end of the string ).If the string reaches an end, the loop breaks and will return the final length of the string.