Computer Science Canada Indent error - Don't know what I'm doing wrong! |
Author: | scarcityofmiracles [ Sat Oct 04, 2014 6:15 pm ] |
Post subject: | Indent error - Don't know what I'm doing wrong! |
Hi guys, I'm a beginner programmer and I'm starting on Python 3. Here is a particularly problematic piece of code, displayed in the picture. There is an error message regarding indenting. Yet I'm typing out the code exactly as I see it in the book. Furthermore, there's only 5 lines of code; I shouldn't make any mistakes yet! I'd appreciate anyone's help. |
Author: | Dreadnought [ Sat Oct 04, 2014 6:44 pm ] |
Post subject: | Re: Indent error - Don't know what I'm doing wrong! |
Notice that the "if" is preceeded by ">>>" so it doesn't actually have any preceding indentation, therefore your elif should not have any indentation (i.e. it should be as far to the left as possible). When typing just hit backspace to go back one indentation level. |
Author: | scarcityofmiracles [ Mon Oct 06, 2014 3:33 pm ] |
Post subject: | Re: Indent error - Don't know what I'm doing wrong! |
Your advice worked, thanks a bunch! |