livepython.net

5. Python Program to Print Multiple Lines with One print()

EasyEscape sequences

Overview

In this exercise, you will learn how to print multiple lines using a single print() function call. This question emphasizes Python's handling of strings and escape sequences for formatting text.

Problem Statement

Write a Python program that prints the following text using a single print() function:

I am learning Python
I love Python
I love LivePython.net

Input

  • No input is required.

Output

The program should output the following:

I am learning Python
I love Python
I love LivePython.net

Enjoy learning and practicing escape sequences in Python!

Learn this firstChapter 2 · Escape Sequences in Python: \n, \t and More
solution.py
# write your code here

EXPECTED OUTPUT

1I am learning Python
2I love Python
3I love LivePython.net

YOUR OUTPUT

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