Command Palette

Search for a command to run...

Hectal
Phase 0: Start Here: Programming and Python from Zero
Python · Exercise 3 of 5 PreviousNext
Beginner

Add up a snack bill

A tea costs 15 and a samosa costs 20. The program already remembers both prices.

Create a variable named total that adds the two prices, then print it in the form Total: 35. (A variable is a name that remembers a value, like tea and samosa above. Topic 1.1 teaches variables.)

Calculate the total from tea and samosa; don't type 35 yourself.

What Check tests

  1. There is a variable named total
  2. total is 35
  3. total is calculated from tea and samosa
  4. The program prints Total: 35

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

main.py
Sign in to run your code.

Output

Press Run to see what your program prints.