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

Subsetting lists

Now that you have your recipe scaler set up with the two lists (ingredients and quantities), you want to create a quick preview of your shopping list. You'll need to access specific items from your lists to display the first few ingredients and their amounts, as well as check what the last item on your list is.

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.

ingredients = ["fusilli", "tomatoes", "garlic", "basil", "olive oil", "salt"]
quantities = [500, 400, 15, 20, 30, 10]

# Get the second ingredient for your preview
second_ingredient = ____

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