Python indentation

In python, there are two ways of indentation: tab or spaces(4 spaces).

However, I use WingIde, Visual Studio Code and Atom editor alternatively (do not ask why) depends on my purposes. And they are not consistently on how to indentify Python file.

Well, long story short, I use Wingide to normalize the format of python file and by chance, it changes the location of my return statement

This is the “problem” one:

wrong.png

I took me more than a few days to reconigize the mistake while the return value is only 1 item no matter what i enter! and debug of course.

The correct version is

Screenshot_2016-04-12_16-19-31.png

Thanks god.

 

Lesson learnt:

  1. use only one editor if it is possible (not for me)
  2. do not mess with format if it works
  3. Be careful
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s