python print 按逗号或空格分隔的方法
这篇文章主要介绍了关于实现python print 按逗号或空格分隔的方法,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下
1)按,分隔
a, b = 0, 1 while b <p><span style="color: #ff0000"><strong>2)按空格分隔</strong></span></p><pre class="brush:php;toolbar:false">a, b = 0, 1 while b <p><span style="color: #ff0000"><strong>3)print的用法</strong></span></p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/00968c3c2c15" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">Python免费学习笔记(深入)</a>”;</p><pre class="brush:php;toolbar:false">print(...) print(value, ..., sep=' ', end='', file=sys.stdout, flush=False) Prints the values to a stream, or to sys.stdout by default. Optional keyword arguments: file: a file-like object (stream); defaults to the current sys.stdout. sep: string inserted between values, default a space. end: string appended after the last value, default a newline. flush: whether to forcibly flush the stream.