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! While you're at it, check out some resources Treehouse students have shared here.

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

Python Python Basics (2015) Shopping List App Refactor

Cameron Hastings
Cameron Hastings
3,439 Points

Is formatting in python important? I noticed some of these challenges will not work without proper formatting.

Is it? It has made some of these challenges really difficult/frustrating to figure out.

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Cameron,

Python is one of the most picky and specific languages i can think of. Which often makes me wonder why so many people say to start with python as it's the easiest to learn? I, personally, found it one of the more complex and complicated ones to learn...
But, yes, formatting matters a great deal. Indentation is the most important formatting aspect of Python. Many languages will use Curly Braces or Keywords to designate certain parts of its code (e.g. the body of a function, the execution inside of an if/else block, etc), but python utilizes indentation for this. With Python, even if you have just one extra space or are missing one space in a indented line, the program will not compile and your code will break.

So, yes, with Python, learning and abiding by its rules is crucial to a successful build. Just like you need to know where and how to use curly braces or semicolons in Java, you'll need to learn the 'rules' of Python.

Keep coding! :) :dizzy: