Week 3

Python the Number Wizard

Aim: Use Python's maths operators to solve calculations and store the results.

New coding words

  1. operator
  2. calculation
  3. integer
  4. result
  5. expression

What the coding words mean

  1. operator: A symbol that tells Python which maths action to perform, such as +, -, * or /.
  2. calculation: Using numbers and operators to work out an answer.
  3. integer: A whole number without a decimal point, such as 12.
  4. result: The answer produced by a calculation.
  5. expression: A piece of code that Python can calculate, such as 5 + 3.
Code along

Calculate with Python

Use Python's maths operators to calculate and display four answers.

Python coding spaceReady to run
.py

Tab indents. Esc then Tab leaves the editor. Ctrl/⌘ + Enter runs your code.

Output (Shell)What your program does
Select Run my code to try this program.
Opening your coding space…Each activity has its own saved code.
Mini project

Space Mission Calculator

Calculate supplies for a pretend journey to the Moon.

Python coding spaceReady to run
.py

Tab indents. Esc then Tab leaves the editor. Ctrl/⌘ + Enter runs your code.

Output (Shell)What your program does
Select Run my code to try this program.
Opening your coding space…Each activity has its own saved code.

Your mini-project to-do list

0 of 4 completed

Complete these activities in the mini-project editor above. After each change, select Run my code to check your program’s output or drawing.

Save your finished mini project

Select Download my work and save the file as week_3_space_mission_calculator.py. The .py ending tells us that the file contains Python code. Keep this file as a copy of your finished program.

Debugging detective

Chi Opara, your course guide

Knowledge check

Question 1

Which symbol means divide in Python?

Choose one answer
Question 2

Write Python code to find the cost of three toys at 4 pounds each.

Your answers are checked in this browser and are not submitted.

How are you getting on so far?

My checklist

Finished Week 3?

This progress is saved only in this browser.