Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 7 Online
OpenStudy (anonymous):

Sometimes python 2.5.4. does not automatically indent, so I indent 4 spaces and I always get an error. I am stuck on the third lecture! How do I fix this?

OpenStudy (anonymous):

for example after a while statement and two indented lines below it, if will not go back to the margin.

OpenStudy (anonymous):

What editor are you using?

OpenStudy (anonymous):

I think some editors require consistency between using tabs and spaces..You can't combine both in the same script.. I use Sublime Text, and no issues with the Python compiler.

OpenStudy (anonymous):

If you are using vim, put this into your .vimrc and everything will work flawlessly: " 1 tab = 4 spaces, auto indenting filetype indent plugin on set tabstop=8 set expandtab set shiftwidth=4 set softtabstop=4

OpenStudy (rsmith6559):

Although visually the same, four spaces are not the same as one tab. Blocks of code (the indented lines) have to use the same indentation throughout that block. IDLE has a problem with this, so it's not one that I use.

OpenStudy (anonymous):

I do not understand why the professor of the course can use python Idle with no problems, and I can't!

OpenStudy (e.mccormick):

Are you typing a colon after ifs and loops? if <condition>: \(\leftarrow\) it is that : that triggers the indent.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!