Command Palette

Search for a command to run...

Hectal
Phase 4: Lists, Tuples, Dictionaries and Sets
Python · Exercise 3 of 6 PreviousNext
Beginner

Maintain a price list

prices starts as {"apple": 30, "banana": 12, "mango": 50}.

Change the price of "apple" to 35, add "kiwi" at 40, and remove "banana".

Then print every entry on its own line in the form apple: 35, in the dictionary's order.

What Check tests

  1. prices ends as apple 35, mango 50, kiwi 40
  2. "banana" is removed
  3. The lines are apple: 35, mango: 50, kiwi: 40

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.