Python内置函数print()是基本输出函数,可以使用help()函数查看其详细用法和参数含义:>>> 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.下面演示一下这个函数的几种用法:(1) 输出多个对象的值,改变多个值之间的分隔符# 使用默认分隔符>>> print(1,3,5)1 3 5# 使用指定的分隔符>>> print(1,3,5, sep=',')1,3,5>>> print(1,3,5, sep=':')1:3:5(2
………………………………