Python基础语法-菜鸟教程-函数用法:print()

1)用法解释
def print(self, *args, sep=’ ‘, end=’
‘, file=None): # known special case of 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.
“”"
pass
2)使用实例
eg:有如下实例
print(“one two three”, sep=‘zzz’, end=‘tt’, file=None)

上述实例输出结果为:
one two threett

发布了25 篇原创文章 · 获赞 0 · 访问量 217

猜你喜欢

转载自blog.csdn.net/qq_33410995/article/details/104181404