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

Updating variables

You've stored the initial values for a pasta recipe, but now you realize you need to make some adjustments. You prefer "fusilli" pasta instead of spaghetti, and you've decided to use more of it. In Python, you can easily update variables by reassigning them new values, just like you did when you first created them.

Let's practice updating your recipe variables and printing the new values to confirm the changes.

Bu egzersiz

Introduction to Python for Developers

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

Egzersiz talimatları

  • Update the pasta_type variable to store the string "fusilli" instead of its current value.
  • Update the quantity variable to store the integer 100 instead.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

print(pasta_type)
print(quantity)

# Update the pasta type to fusilli
pasta_type = ____

# Update the quantity to 100
quantity = ____

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