for loop

Chris Warrick kwpolska at
Sun Sep 20 10:03:36 CEST 2015

On 20 September 2015 at 09:55, shiva upreti <katewinslet626 at> wrote:
> Please tell me why 'print s' statement is being executed inside loop, though I put it outside.
> Please help. I am new to python.
> --

You have mixed indentation. Your code contains both tabs and spaces.
Python interprets tabs as 8 spaces, while your other indentation is 4
spaces, leading to bad parsing.

Please make sure you use only spaces (reconfigure your editor to
always insert 4 spaces and reindent everything with tabs)

Chris Warrick <>

More information about the Python-list mailing list