for loop

Chris Warrick kwpolska at gmail.com
Sun Sep 20 04:03:36 EDT 2015


On 20 September 2015 at 09:55, shiva upreti <katewinslet626 at gmail.com> wrote:
> https://ideone.com/BPflPk
>
> Please tell me why 'print s' statement is being executed inside loop, though I put it outside.
> Please help. I am new to python.
> --
> https://mail.python.org/mailman/listinfo/python-list

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 <https://chriswarrick.com/>
PGP: 5EAAEA16



More information about the Python-list mailing list