|
发表于 2020-10-27 22:27:11
|
显示全部楼层
本帖最后由 笨鸟学飞 于 2020-10-27 22:28 编辑
help(print)
Help on built-in function print in module builtins:
print(...)
print(value, ..., sep=' ', end='\n', 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.
======以上是函数帮助文档======
sep=' ' #意思你函数内输入多个参数,默认用空格隔开
end='\n' #意思你函数内结尾不自定义参数,则默认用换行结尾
======验证=================
>>> print(1,2,3)
1 2 3
>>> print(1,2,3,sep='') #自定义sep=空字符串,而不是默认的空格
123
>>> print('hello world',end='\n\n') #比默认的多一个换行符
hello world
#换了2行
>>> print('hello world')
hello world |
|