Home > Backend Development > Python Tutorial > What does sep mean in python?

What does sep mean in python?

爱喝马黛茶的安东尼
Release: 2019-06-21 09:36:37
Original
54237 people have browsed it

The full name is Separate, which means separated
Used to customize the separator when printing two elements (the default is two spaces)

The keyword parameter sep is the implementation separator, such as multiple When outputting parameters, you want to output the middle delimiting character

What does sep mean in python?##

print(1, 2, 3, sep = ',', end = '\r\n')
print(1, 2, 3, sep = ' ', end = '\r\n')
Copy after login

Related recommendations: "

python video tutorial"

The result output is as follows:

1,2,3
1 2 3
Copy after login
print("file\n","abc","bcd","fff\n","poi")
print("-------------")
print("file\n","abc","bcd","fff\n","poi",sep='')
print("-------------")
print("file\n","abc","bcd","fff\n","poi",sep=' ')
print("-------------")
Copy after login

The result is:


file
 abc bcd fff
poi-------------file
abcbcdfff
poi-------------file
 abc bcd fff
poi-------------
Copy after login

The above is the detailed content of What does sep mean in python?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template