range() with len() for indexing into a string : Length « String « Python Tutorial






foo = 'abc'
for i in range(len(foo)):
   print foo[i], '(%d)' % i








5.13.Length
5.13.1.Get the length of an input string
5.13.2.range() with len() for indexing into a string
5.13.3.take a string and display it in a loop.
5.13.4.Get the final index of our string is:
5.13.5.Measure some strings: