Two Football Teams
Python
15 pts
Two Football Teams
Two teams are stored in sets: asmara_team and keren_team. Some players play for both.
- Create
all_players— every player in at least one team (union). - Create
in_both— the players in both teams (intersection). - Print both with
sorted().
Expected output:
['Abel', 'Merhawi', 'Ruta', 'Selam', 'Yonas'] ['Abel', 'Merhawi']
Checklist
- Keep both team sets unchanged and create
all_players, every player in at least one team. - Create
in_both, the players in both teams. - Print both with
sorted().
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
