Hello , I have the following code:
count = 0
phrase = "hello, world"
for iteration in range(5):
index = 0
while index < len(phrase):
count += 1
index += 1
print "index: " +str(index)
print "Iteration " + str(iteration) + "; count is: " + str(count)
I can't understand why index goes until value 12.When index=11 ,the condition index<len(phrase) (11<12) is true ,
but when index becomes 12 ,the condition is false.Why then the value of index is 12?
Thanks!