Writing Multiple Lines in Python
📖 Scenario: Imagine you want to write a short note with multiple lines to share with a friend. You will learn how to create and print multiple lines of text in Python.
🎯 Goal: You will build a small program that stores a three-line message and prints it exactly as written, with each line on its own line.
📋 What You'll Learn
Create a variable called
message that holds three lines of text exactly as given.Use triple quotes to write the multiple lines inside
message.Create a variable called
separator that holds a string of three dashes ---.Print the
message variable.Print the
separator variable.💡 Why This Matters
🌍 Real World
Writing multi-line text is useful for creating messages, letters, or formatted output in programs.
💼 Career
Understanding how to handle multi-line strings helps in many programming tasks like generating reports, emails, or documentation.
Progress0 / 4 steps