时间:2021-07-01 10:21:17 帮助过:774人阅读
关键字参数sep是实现分隔符,比如多个参数输出时想要输出中间的分隔字符
print(1, 2, 3, sep = ',', end = '\r\n') print(1, 2, 3, sep = ' ', end = '\r\n')
相关推荐:《python视频教程》
结果输出如下:
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("-------------")
其结果为:
file abc bcd fff poi-------------file abcbcdfff poi-------------file abc bcd fff poi-------------
以上就是python中sep是什么意思的详细内容,更多请关注Gxl网其它相关文章!