This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author victorywin
Recipients victorywin
Date 2011-03-07.03:22:37
SpamBayes Score 7.177826e-05
Marked as misclassified No
Message-id <1299468158.04.0.349961961476.issue11422@psf.upfronthosting.co.za>
In-reply-to
Content
Hi dear developers,
"Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32"
Hello,
Several days ago I downloaded Python 3.2, the standard windows installer, for windows vista. Here's the bug:
in the Python-command line, the following works:
"
>>>if 2==2:print('yes')
...else:print('n')
...
yes
"
Now, in the Python shell (IDLE-python gui, the standard one included with the installer of python), the only way it works is:
>>> if 2==2:print('yes')
else:print('n')

yes

So, it requires me to put "else" unindented. On the other hand, if the "if--else" statement is included in the definition of a function, then it requires that "else" be exactly under "if". Same is true when using "elif".
This was frustrating, when trying to learn "if-else" statement, because it took me half an hour of experimenting.
Shouldn't it be consistent?

Victor
History
Date User Action Args
2011-03-07 03:22:38victorywinsetrecipients: + victorywin
2011-03-07 03:22:38victorywinsetmessageid: <1299468158.04.0.349961961476.issue11422@psf.upfronthosting.co.za>
2011-03-07 03:22:37victorywinlinkissue11422 messages
2011-03-07 03:22:37victorywincreate