Summer Deals - hours only!Up to 80% off on all courses and bundles.-Close
Recap
Using sets to compute unique elements
Set operations
Simulating machines
Summary
15. Question 2

Instruction

Perfect! One more question to go ...

Exercise

You are given a restaurant menu in the template code. This menu is stored in tuples; each tuple consists of a dish name and a list of its ingredients.

We want to find out how many unique ingredients are used in this restaurant. Write a function named count_unique_ingredients(dishes) that accepts a list of tuples (as shown in the template code). This function should return the total number of unique ingredients from all the dishes in the list.