Skip to main content

2.8) Syntax Is Crucial


Important:

The case (i.e. uppercase versus lowercase) matters in Python! See for yourself by trying out the following:

>>> PRINT 3

You get an error because uppercase "PRINT" is not a command but lowercase "print" is. Always pay attention to lower/upper case writing code.

Don’t start your lines of code with a space, it will return the following error:

IndentationError: unexpected indent

An important skill in programming is being able to find syntax mistakes in code. You develop this skill by practicing, just like you would practise playing an instrument. So for this course, there is an important rule to follow:

Every time you see an example, type it out yourself in IDLE or in a file.

Do not copy-paste the examples.

If you get an error when typing the code, you probably missed out or inserted a wayward colon, space, bracket or comma. Try to find the mistake or as a last resort write the code again from scratch.