Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Indent error - Don't know what I'm doing wrong!
Index -> Programming, Python -> Python Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
scarcityofmiracles




PostPosted: 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.



Capture.PNG
 Description:
 Filesize:  107.14 KB
 Viewed:  261 Time(s)

Capture.PNG


Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: 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.
scarcityofmiracles




PostPosted: 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!
Display posts from previous:   
   Index -> Programming, Python -> Python Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: