I'm not sure what's happening in my code. But I'm trying the excercice in notepad++ and load it into python terminal. [code is not complete, I'm just not sure why I get this output]
When I import the code it prints all the "print" after the for loop like it is in the for loop for. I assume it's because it has text[c] in one print (I have no clue why it would print the other one) and c is defined in the for-loop, but when I add it to the loop I get an "unexpected indent" Error.
When I remove the last "print"-line [print "not in for loop??"] and reload the file back into python the for loop only runs once. Because this makes no sense for me.
def reverse(text): new = () for x in range(1,len(text)+1): c = len(text) - x print c print "\t", text[c] print "not in for loop??" return
3 d not in for loop?? 2 c not in for loop?? 1 b not in for loop?? 0 a not in for loop??