Python Sneks Curriculum

Click here to return to the list of pages

Languages

Download slides

What is a Programming Language?

Programs are created by writing programs in a programming language. Programming languages were created by people to give computers clear instructions.

Picture of woman writing some instructions in pseudocode on a computer.

Python and Its Competition

In this course, you are learning a programming language named Python. However, there are many programming languages out there.

Collage of icons from many different programming languages, including Java, Ruby, C++, PHP, and JavaScript. In the center, Python’s icon is circled.

Why Python?

You might be wondering why Python is a good language to learn, if there are so many options. First, Python is one of the most popular languages in the world. Second, it has a huge number of libraries that make it useful for a wide range of problems. Third, it is a friendly language for beginners.

On the left, a list of 3 words: popular, useful, and friendly.
In the middle, a list of the 2019 most popular programming languages taken from the Tiobe index. Python is #3.
On the right, a list of application areas that Python is useful for: Scientific computing, web servers, data science, game development, and scripting languages.

A Small Language

Imagine you were giving commands to a very small child in English. The child only knows a few words. If they don’t know a word, you will have to explain it to them using words they already understand. Programming Languages are similar to this - you build new words using a small set of original words.

A series of four speech bubbles (saying “Small Word”) being sequentially added together. An arrow emerges from the group pointing towards one big speech bubble (saying “New Big Word”).

Commands

Human languages, like English, can be used to talk about many complex ideas. However, programming languages are good for only one thing: giving instructions to a computer. We don’t use programming languages to talk to each other the same way we do human languages.

A pair of speech bubbles, as if having a conversation. The left speech bubble says “Go to the Market. Get me eggs and milk. Then return home.” The right speech bubble responds, “Don’t tell me what to do!”

Rules

Programming languages have very strict rules. This is similar to how we have rules in English. There are two kinds of rules: syntax and semantics.

On the left, a list titled “Syntax” followed by “Grammar”, “Spelling”, and “Punctuation”. On the right, a list titled “Semantics” followed by “Logic”, “Making Sense”, and “Intent”.

Syntax

In English, we follow grammar rules about how we can structure our sentences. The sentence below is not grammatically correct english, so we would reject it. Similarly, in Python, we use symbols, spaces, and words in very precise ways. Using them incorrectly will give you a “syntax error”. You will probably make many syntax errors as you learn to program.

The nonsense text “Run can . upways tHe, to healp?!?” is shown, with speech bubbles annotating various syntactic errors. In particular, the bubbles point to a bad period, bad capitalization, and bad spelling.

Semantics

Although the sentence below follows grammar rules, it doesn’t make any sense. This is the idea of semantics. It is very easy to write perfectly valid sentences in Python that accomplish nothing at best and hurt things at worst. You need to think when programming, to recognize when you’ve written something that makes no sense.

The nonsense text “Colorless green ideas sleep furiously” is shown, with speech bubbles annotating various semantic errors. In particular, it highlights that “ideas can’t sleep”, you can’t have something that is “colorless bug green” and it is meaningless to be “sleeping furiously”.