IniziaInizia gratis

Multi-line strings

Your recipe scaler project needs to store detailed cooking instructions for each recipe. These instructions often span multiple lines and include several steps. You'll practice storing a multi-line string that contains the complete cooking directions for a pasta dish, making it easy to read and maintain in your code.

Questo esercizio fa parte del corso

Introduction to Python for Developers

Visualizza il corso

Istruzioni dell'esercizio

  • Create a multi-line string variable called cooking_instructions that contains the three-step pasta cooking process shown in the comments.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Store the multi-line cooking instructions
# Step 1: Boil water in a large pot
# Step 2: Add pasta and cook for 10 minutes
# Step 3: Drain and serve with sauce
cooking_instructions = ____

print(cooking_instructions)
Modifica ed esegui il codice