Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Avernell ChristopherData Analysis Techdegree Student 7,805 Points
Help with fixing errors with this code. Particularly indentation. Is there a rule to avoid indentation errors.
Here is an example of the code https://w.trhou.se/hztbtykfnx
Steven Parker224,872 Points
Remember that in Python, indentation isn't just for readability like in most languages. It identifies blocks of code such as the body of a loop or the content of a conditional.
Always be consistent with the depth of the indentation. You allowed to pick this yourself; but if you don't have a strong reason to use something else, the PEP 8 standard of 4 spaces per level is highly recommended.
Refer to the PEP 8 documentation for more suggestions and examples of proper indentation.