Tutorial Outline
1. Python program to print multiline string on the console screen using new line escape character.
2. Python program to print multiline string on the console screen using three single quotes.
3. Python program to print multiline string on the console screen using three double quotes.
Input no input
Output
Hello World!
Welcome to the world of Python 3...
Let us learn Python 3 Programming!!
1. Python program to print multiline string on the console screen using new line escape character.
"""
Program: Python 3 program to print following multiline message on the console screen using new line escape character...
Hello World!
Welcome to the world of Python 3...
Let us learn Python 3 Programming!!
Date: Monday, 01-03-2021
@author: Ankur Saxena
Platform: Linux Ubuntu 20.04 Lts/x64/Python 3.6/Vim editor
"""
# program start
# printing message
print ("Hello World!\nWelcome to the world of Python 3...\nLet us learn Python 3 Programming!!\n")
# program end
# Save this file as "HelloWorld2.py"
# Execute: $ python HelloWorld2.py
"""
Output:
Hello World!
Welcome to the world of Python 3...
Let us learn Python 3 Programming!!
"""
2. Python program to print multiline string on the console screen using three single quotes.
"""
Program: Python 3 program to print following multiline message on the console screen using three single quotes.
Hello World!
Welcome to the world of Python 3...
Let us learn Python 3 Programming!!
Date: Monday, 01-03-2021
@author: Ankur Saxena
Platform: Linux Ubuntu 20.04 Lts/x64/Python 3.6/Vim editor
"""
# program start
# printing message
print('''
Hello World!
Welcome to the world of Python 3...
Let us learn Python 3 Programming!!
''')
# program end
# Save this file as "HelloWorld3.py"
# Execute: $ python3 HelloWorld3.py
"""
Output:
Hello World!
Welcome to the world of Python 3...
Let us learn Python 3 Programming!!
"""
3. Python program to print multiline string on the console screen using three double quotes.
"""
Program: Python 3 program to print following multiline message on the console screen using three double quotes.
Hello World!
Welcome to the world of Python 3...
Let us learn Python 3 Programming!!
Date: Monday, 01-03-2021
@author: Ankur Saxena
Platform: Linux Ubuntu 20.04 Lts/x64/Python 3.6/Vim editor
"""
# program start
# printing message
print("""
Hello World!
Welcome to the world of Python 3...
Let us learn Python 3 Programming!!
""")
# program end
# Save this file as "HelloWorld4.py"
# Execute: $ python3 HelloWorld4.py
"""
Output:
Hello World!
Welcome to the world of Python 3...
Let us learn Python 3 Programming!!
"""
You can also follow me on my GitHub Profile given below for topics related to programming languages like Python, Java, C, C++, JavaScript, Kotlin, etc.
0 Comments