Skip to content

Latest commit

 

History

History
92 lines (70 loc) · 4.13 KB

2 Lesson Languages.md

File metadata and controls

92 lines (70 loc) · 4.13 KB

In today's lesson, you'll learn some fundamental terminology about programs. You will also be installing Python.

&icon-check-plus; Objectives

  1. Define the term "programming language"
  2. Describe the difference between syntax, grammar, and semantics
  3. Explain the meaning of the terms "run" and "execute".
  4. Install Python on your laptop.
  5. Use BlockPy to run a program.

&icon-quiz; Activities

&icon-educators; Lesson

Download Slides: Languages.pptx{: .instructure_file_link .instructure_scribd_file}

<iframe height="150" width="300" style="width: 640px; height: 480px;" webkitallowfullscreen="webkitallowfullscreen" title="Languages" mozallowfullscreen="mozallowfullscreen" src="https://www.youtube.com/embed/soKi0pWmyuo?feature=oembed&rel=0" allowfullscreen="allowfullscreen"></iframe>

&icon-eye; Show/Hide Transcript

Slide 1 - Programming Languages:
Let's learn about programming languages.

Slide 2 - 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.

Slide 3 - Python and its Competition:
In this course, you are learning a programming language named Python. However, there are many programming languages out there.

Slide 4 - 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.

Slide 5 - 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.

Slide 6 - 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.

Slide 7 - 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.

Slide 8 - 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.

Slide 9 - 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.

&icon-document; Optional Readings

The following readings should be relevant. Remember, all readings are optional!

&icon-flag; Summary

Programs are written by programmers using programming languages such as Python.