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