Home > Article > Backend Development > What does sep mean in python?
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
##
print(1, 2, 3, sep = ',', end = '\r\n') print(1, 2, 3, sep = ' ', end = '\r\n')Related recommendations: "
python video tutorial"
The result output is as follows:1,2,3 1 2 3
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("-------------")The result is:
file abc bcd fff poi-------------file abcbcdfff poi-------------file abc bcd fff poi-------------
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!