Building a list
Now that you understand how lists work in Python, it's time to build the foundation of your recipe scaler project! You'll create lists to store the ingredients and their quantities in grams.
This exercise is part of the course
Introduction to Python for Developers
Exercise instructions
- Create a list called
ingredientscontaining the following strings:"fusilli","tomatoes","garlic","basil","olive oil", and"salt", in that order. - Create a list called
quantitiescontaining the following numbers:500,400,15,20,30, and10, in that order.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create a list of ingredients
ingredients = ____
# Create a list of ingredient quantities
quantities = ____
print(ingredients)
print(quantities)