Wednesday, June 10, 2015

Length of a string with out len() function - Python

st = " This is awesome!"
count = 0

for x in st:
count = count + 1
print count
if(len(st) == count):
print "it works!"

No comments:

Post a Comment