livepython.net

10. Python Program to Print Multiple Lines Without Escape Sequences

EasyTriple quotes

Overview

In this exercise, you will learn how to print multiple lines of text using Python's print() function without relying on escape sequences like \n. This can be achieved using triple quotes, which are a powerful feature in Python for handling multi-line strings.

Problem Statement

Write a Python program that prints multiple lines of text in a single print() statement without using any escape sequences line (\n) or (\").

Input

  • No input is required.

Output

Your output should match the following format exactly:

This is "line 1".
This is 'line 2'.

Use this feature to print clean multi-line text without escape sequences. Happy learning and coding!

Learn this firstChapter 2 · Triple Quotes in Python: Multi-Line Strings
solution.py
# write your code here

EXPECTED OUTPUT

1This is "line 1".
2This is 'line 2'.

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.