Get startedGet started for free

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.

This exercise is part of the course

Introduction to Python for Developers

View Course

Exercise instructions

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

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# 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)
Edit and Run Code