Alterna · learning material
Bandages and Comparisons
Chapter 35: Programming: branching and comparison, short explanations, diagrams, trajectory and practice.
What this material covers
- Alt checkpoint: condition opens gate
- Headway
- Condition if / elif / else
- Logical expressions
- min and max without finished functions
- Workshop
- Skills testing
- Python studio
Content and key concepts
ALT
Alt checkpoint: condition opens gate
Change age and pass, then execute
if
The gate will only open if both parts of the condition are true.
VERIFICATION OF ACCESS
Pending verification
ALT
The Gate Waits for a Decision
if age >= 14 and has_pass:
gate = "open"
else:
gate = "closed"
age
13
We need to check both values.
The program begins to make decisions: it calculates the condition, selects one branch and continues to work with the new state.
substance and practice
Grade 8
OGE No. 6
OGE No. 16
01
Headway
The workshop and the exam test test are not guessing, but the steady skill of analysis and code writing.
35.1 · Theory and track
Condition if / elif / else
The if/elif/else chain is seen from the top down and performs only the first branch with the true condition.
Open topic
35.2 Theory and track
Logical expressions
And requires the truth of all parts, or — at least one, not changes the result to the opposite. Comparisons can be combined in chains.
Open topic
35.3 Theory and track
min and max without finished functions
To understand the branch deeper, we will build a minimum and maximum by hand: we will start the current candidate and replace him only with a stronger value.
Open topic
35.4 Practice
Workshop
Twenty diagnostic questions with four outcomes and eight programme tasks with additional tests.
Start training
35.5 Monitoring
Skills testing
The timer does not drop when rebooted, correct is hidden until the end, the program task is mandatory.
Open option
35.6 · Copyright code
Python studio
Choose a problem, change the algorithm, and pass the visible and hidden tests in the isolated runtime.
Open the studio.