๐Ÿ›ฐ๏ธ Python, Grade 8 ยท session 4 of 16 ยท 60 minutes ยท ๐ŸŽ free with an account

Mixed practice 1: mission week

Mission week: no new commands today, just practice. Each part mixes two of the first three lessons, starting easy and ending with problems a real programmer would enjoy.

๐ŸŽ Unlock free: make an account
Illustration of a cute pastel robot dancing
Illustration: andremsdesign / Pixabay

A complete lesson ยท 60 minutes

Teach it, see it, practise it, all on this page.

Open this page with your learner and work down it, or press Teach this lesson to go through it one step at a time on a big screen. Every section has something to do.

  1. Warm-up3 min
  2. Warm-up games5 min
  3. Numbers and f-strings9 min
  4. Decisions9 min
  5. Loops with decisions9 min
  6. Shop till7 min
  7. Number detective7 min
  8. Times-table quiz5 min
  9. Quiz5 min
  10. Set the after-class project1 min

By the end you can

  • Choose the right tool: maths, f-strings, if or a loop
  • Combine decisions and loops in one program
  • Read a problem, plan it, then code it
  • Debug by running small tests

Before you start

  • Lessons 1 to 3 of this course

Have ready

  • A computer or tablet with this page open
  • Paper for planning

Grade 8 ยท ages 13 and 14 ยท no experience needed

Warm-up ยท think first

What is the smallest number that leaves a remainder of 1 when divided by 2, 3, 4, 5 and 6?

Show the answer

61: 60 is the smallest number all of them divide into, and 60 + 1 = 61.

Teacher tip: Later: how could a while loop find it without any cleverness?

More warm-ups for every class โ†’

๐ŸŽฎ Warm-up games ยท 5 quick games

Play with Bolt the robot

Five minutes with NOVA, the station computer. Vote, say why, then show the answer.

  1. Which line doesn't belong: print(10 // 3), print(7 % 4), print(3 ** 1), print(9 / 3)? (print(10 // 3) ยท print(7 % 4) ยท print(3 ** 1) ยท print(9 / 3))
    Answer: print(9 / 3) is the odd one: it shows 3.0, a decimal, and the others show the whole number 3.
  2. Would you rather write a loop that runs 100 times, or copy the same line 100 times? (A loop that runs 100 times ยท Copy the line 100 times)
    Answer: The loop: two lines instead of a hundred, and easy to change.
  3. A for loop can be rewritten as a while loop. (Always ยท Sometimes ยท Never)
    Answer: Always โ€” Always. Any for loop can be written with a counter and while.
  4. How many different programs can you think of that print the numbers 1 to 5?
    Answer: Many: five prints, a for loop, a while loop, a loop with a step, even a countdown reversed. Collect them.
  5. How many times does the digit 7 appear when you write all the numbers from 1 to 100?
    Answer: 20 times: ten 7s in the ones place (7, 17, โ€ฆ 97) and ten in the tens place (70 to 79), with 77 having one of each.

Three levels, like a real engineer

Use it. Tweak it. Build it.

First use what the lesson shows exactly as it is, then change one key thing and see what happens, then make your own.

  1. ๐Ÿ”’

    Level 1 ยท Use it

    Run the crew check

    Run the Crew Check example exactly as written: a for loop over range(1, 4) with an indented if and else inside it. Notice which crew rests and what each line prints.

  2. ๐Ÿ”ง

    Level 2 ยท Tweak it

    Change Crew Numbers

    In 'Crew Check', change range(1,4) to range(1,6) and crew == 2 to crew == 3. Predict what changes, then run it and check.

  3. ๐Ÿ› ๏ธ

    Level 3 ยท Build it

    Build Mission Checker

    Make your own mission program with a loop, an if, and an f-string. Check 5 oxygen tanks and print each tank's status. Test it with small runs.

Part 1 of 3 ยท learn, see, practise

Remix: numbers and f-strings

Mission week, day 1: the reports. Every answer must be worked out by me, and every report must look tidy.

Plan first: what are the inputs, what is the sum, what should the output look like?

Store answers in variables with clear names, then print them with an f-string. Use :.2f for money and round() only when the task asks for it.

๐Ÿง‘โ€๐Ÿซ Teacher: type this live with the class

Circle report

  1. import math

    math gives us pi and square roots.

  2. r = 7

    A radius.

  3. area = math.pi * r ** 2

    Power before times: r squared, then times pi.

  4. print(f"Area: {area:.2f}")

    Two decimal places: 153.94.

Type here

โ–ถ Output

(nothing is printed)

๐Ÿ“ฆ Memory boxes

No variables yet
Example: run it, then change it

โ–ถ Output

A 10 m square has a 14.1 m diagonal

๐Ÿ“ฆ Memory boxes

math<module 'math'>moduleside10intdiagonal14.142135623730951float

Pythagoras in one line. Change side and run again.

Practise it

Start with the warm-up and go as far as you can. The stretch questions are meant to be hard.

Warm-up

1.1 Print the area of a circle with radius r, to 2 decimal places, like Area: 153.94

Task 1.1

โ–ถ Output

(nothing is printed)

๐Ÿ“ฆ Memory boxes

math<module 'math'>moduler7int
๐Ÿง‘โ€๐Ÿซ Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 1 line the student writes

import mathr = 7print(f"Area: {math.pi * r ** 2:.2f}")

What it prints

Area: 153.94

What โœ“ Check looks for

  • it prints exactly:
    Area: 153.94
  • With r = 1, it prints exactly:
    Area: 3.14
  • In the code: Use math.pi.
Warm-up

1.2 A marathon is km kilometres. Print it in metres as a whole number, like 42195 m

Task 1.2

โ–ถ Output

(nothing is printed)

๐Ÿ“ฆ Memory boxes

km42.195float
๐Ÿง‘โ€๐Ÿซ Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 1 line the student writes

km = 42.195print(f"{round(km * 1000)} m")

What it prints

42195 m

What โœ“ Check looks for

  • it prints exactly:
    42195 m
  • In the code: Multiply by 1000.
Core

1.3 4 friends share a bill and add a 10% tip. Print Each pays: 506.00

Task 1.3

โ–ถ Output

(nothing is printed)

๐Ÿ“ฆ Memory boxes

bill1840intfriends4int
๐Ÿง‘โ€๐Ÿซ Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 1 line the student writes

bill = 1840friends = 4print(f"Each pays: {bill * 1.1 / friends:.2f}")

What it prints

Each pays: 506.00

What โœ“ Check looks for

  • it prints exactly:
    Each pays: 506.00
  • With bill = 1000, it prints exactly:
    Each pays: 275.00
Core

1.4 Ask for a number of days and print weeks and days, like 2 weeks 3 days for 17.

Task 1.4

โ–ถ Output

(nothing is printed)

๐Ÿ“ฆ Memory boxes

No variables yet
๐Ÿง‘โ€๐Ÿซ Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 2 lines the student writes

d = int(input("Days? "))print(f"{d // 7} weeks {d % 7} days")

What it prints when they type 17

Days? 17
2 weeks 3 days

What โœ“ Check looks for

  • When they type 17, the last line it prints is 2 weeks 3 days
  • When they type 70, the last line it prints is 10 weeks 0 days
Stretch ๐Ÿ”ฅ

1.5 BMI is weight divided by height squared. Print BMI: 20.3 to one decimal place.

Task 1.5

โ–ถ Output

(nothing is printed)

๐Ÿ“ฆ Memory boxes

weight52intheight1.6float
๐Ÿง‘โ€๐Ÿซ Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 1 line the student writes

weight = 52height = 1.6print(f"BMI: {weight / height ** 2:.1f}")

What it prints

BMI: 20.3

What โœ“ Check looks for

  • it prints exactly:
    BMI: 20.3
  • With weight = 64, it prints exactly:
    BMI: 25.0
  • In the code: Square the height with ** 2.
Stretch ๐Ÿ”ฅ

1.6 5000 rupees grow by 8% a year for 3 years: P ร— 1.08 ** 3. Print Amount: 6298.56

Task 1.6

โ–ถ Output

(nothing is printed)

๐Ÿ“ฆ Memory boxes

p5000intyears3int
๐Ÿง‘โ€๐Ÿซ Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 1 line the student writes

p = 5000years = 3print(f"Amount: {p * 1.08 ** years:.2f}")

What it prints

Amount: 6298.56

What โœ“ Check looks for

  • it prints exactly:
    Amount: 6298.56
  • With years = 1, it prints exactly:
    Amount: 5400.00
  • In the code: Use ** for the years.

๐ŸŽ Free for a year

Make a free account to open the rest of this lesson

Every new account opens every lesson of every course free for a whole year: no payment, no card, nothing to cancel.

Unlocking the rest of this lesson gives you:

  • Part 2: Remix: decisions, with practice at three levels
  • Part 3: Remix: loops with decisions, with practice at three levels
  • Class activity 1: Shop till
  • Class activity 2: Number detective
  • Class activity 3: Times-table quiz
  • A 8-question quiz
  • After-class project: Mission control quiz game
  • Homework and a printable practice sheet with answers
  • Teach mode and the minute-by-minute teacher's plan

It takes a minute. Anyone under 13 signs up with a parent. The first 2 lessons of every course, every game and all maths practice stay free.

FAQ

Mixed practice 1: mission week: questions

Why a whole lesson of mixed practice?

Mixing topics makes learners choose the right tool, which is the real skill in programming. It also shows what has stuck before new topics arrive.

Start a conversation

Want a teacher to take this class?

Tell us the learner's age and level. A teacher from our network teaches with these lessons; we confirm timing and price first.

  • Tell us the learnerโ€™s age or grade and goals
  • Weโ€™ll suggest a suitable class or learning path
  • Weโ€™ll confirm format, timing and fees with a parent or guardian

For a childโ€™s class, please have a parent or guardian send the enquiry. Avoid sharing passwords or sensitive personal details.

Weโ€™ll use your details only to respond to this request.

Chat on WhatsApp
Esc

Try