How to enter python triple quotation marks

Three quotes, 3 single quotes and 3 double quotes in Python

In fact, 3 single quotation marks and 3 double quotation marks are not often used, but they are of great use in some special format strings. Usually we use single quotes or double quotes to define a character

When stringing, you can only write strings together into one line. If you have to write multiple lines, you have to add a \ to indicate a hyphen after each line, such as:

str1="Listofname:\
HuaLi\
ChaoDeng"

And even if you write like this, you cannot get the expected output:

Listofname:
HuaLi
ChaoDeng

In fact, the output is as follows:

 str1="Listofname:\
... HuaLi\
... ChaoDeng"print(str1)
Listofname:HuaLiChaoDeng

Content expansion:

Usage of python triple quotation marks

1 Multi-line comments

print('Hello world!')"""
This is a
Multi-line comments
Comment,
###
"""

2 Output text in original format

a =""" ###pandas features a number of 
fnctions for reading 'tabular data'as 
 a DataFrame object. Such as, read_csv ...&&&;;;'''hello'''"""
print(a)

So far this article on how to enter python triple quotation marks is introduced. For more related python triple quotation mark input methods, please search for previous articles of ZaLou.Cn or continue to browse related articles below. Hope you will support ZaLou.Cn more in the future. !

Recommended Posts

How to enter python triple quotation marks
How to enter python through the command line
How to comment python code
How to uninstall python plugin
How to use python tuples
python how to view webpage code
How to use python thread pool
How to write python configuration file
How to wrap in python code
How to save the python program
How to install Python 3.8 on Ubuntu 18.04
How to write classes in python
How to filter numbers in python
How to read Excel in Python
How to install Python on CentOS 8
How to solve python dict garbled
How to view errors in python
Steps to enter python through cmd
How does python enter interactive mode
How to write return in python
How to view the python module
How to understand variables in Python
How to clear variables in python
How to understand python object-oriented programming
How to use SQLite in Python
How to verify successful installation of python
How to make a globe with Python
How to use and and or in Python
How to delete cache files in python
How to introduce third-party modules in Python
How to save text files in python
How to write win programs in python
How to run id function in python
How to install third-party modules in Python
How to custom catch errors in python
How to write try statement in python
How to define private attributes in Python
R&D: How To Install Python 3 on CentOS 7
How to add custom modules in Python
How to process excel table with python
How to understand global variables in Python
How to install Python2 on Ubuntu20.04 ubuntu/focal64
How to debug python program using repr
How to learn the Python time module
How to sort a dictionary in python
How to get started quickly with Python
How to add background music in python
How to represent relative path in python
How to upgrade all Python libraries on Ubuntu 18.04
How to use the round function in python
How to convert web pages to PDF with Python
How to use the zip function in Python
How to program based on interfaces in Python
How to install python in ubuntu server environment
How to simulate gravity in a Python game
01. Introduction to Python
How to use the format function in python
How to play happily with Python3 on Ubuntu
How to use code running assistant in python
How to set code auto prompt in python
[Practice] How to install python3.6 on Ubuntu system