Command Palette

Search for a command to run...

Hectal
Phase 1: Values, Variables and Types
Python · Exercise 1 of 6Next
Beginner

Swap two drinks

The program remembers two drinks in the variables first and second. Swap them in one line, so that first holds "coffee" and second holds "tea".

The last line prints both names. After your swap it must print coffee tea.

What Check tests

  1. first is now "coffee"
  2. second is now "tea"
  3. The swap uses the names, not retyped words
  4. The program prints coffee tea

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.