Everything for the Pizza

Python for AIEasy+10 XP+10

Everything for the Pizza

Maya and Ravi are sharing a pizza. Each gives a list of the toppings they want, and some toppings are on both lists.

Task: write toppings_needed(maya, ravi). Return every topping that either of them wants, each once, as a list sorted alphabetically.

Return a sorted list, not a set. If both lists are empty, return [].

Examples

maya = ["cheese", "olives", "corn"]
ravi = ["cheese", "mushroom"]
returns ['cheese', 'corn', 'mushroom', 'olives']
maya = []
ravi = []
returns []

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run