Command Palette

Search for a command to run...

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

Compare two guest lists

Two sets are given: monday and tuesday.

Make both (guests on both days), only_monday (guests on Monday but not Tuesday) and either (guests on at least one day) with set operators.

Print Both: ['Meena', 'Ravi'], Only Monday: ['Asha'] and Either: 5. Use sorted(...) for the first two so the order is stable.

What Check tests

  1. both is Meena and Ravi
  2. only_monday is Asha
  3. either has 5 guests
  4. The three lines are printed

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.