BaşlayınÜcretsiz Başlayın

Working with sets

While building your recipe scaler, you decide to create a shopping list from multiple recipes. You've been collecting ingredients in a list called all_ingredients. Since the same ingredients appear in different recipes, their names appear more than once in the list. You want to create a set to see exactly how many unique ingredients you need to buy. The all_ingredients list has already been created for you.

Bu egzersiz

Introduction to Python for Developers

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Convert the all_ingredients list to a set
unique_ingredients = ____

print(unique_ingredients)
Kodu Düzenle ve Çalıştır