Chapter 1 B1U3 Conditional Execution
This is supplementary material for the corresponding lesson from Python for Everybody.
1.1 Lecture on Analogies
This lecture is not directly related to lesson 2. It shows real-life analogies to gain a better intuition of what programming is about.
- Road analogy
- Definition of program control flow.
- Road as control flow analogy (from Head Frist Programming): sequence, alternative, interconnecting paths, loop.
- Cooking analogy
- Cooking from a cookbook and execution of a program.
- Recipes and programs and their corresponding components.
- A recipe in a pseudo-code.
- Comparison, aka putting all together
- road and cooking analogy,
- flow diagrams,
- statements from a block programming language,
- statements in Python.
- Motivation for iterations on an example interval running training definition.
- Checkingattendance as an example of different iterations (pseudo-code).
- Comparison of syntax and semantics in natural and programming languages.
- Basic types of errors with examples.
198801 U02 10 analogies 01 road
198801 U02 10 analogies 02 cooking
198801 U02 10 analogies 03 comparison
198801 U02 10 analogies 04 iterations
198801 U02 10 analogies 05 errors
total duration: 33:17
1.2 Exercises on Conditional Execution
198801 U03 20 demo 01 tasks
198801 U03 20 demo 02 SqFeet
198801 U03 20 demo 03 debugging
total duration: 24:42
- the material is provided in OLAT