print([object, ...][, sep=' '][, end='\n'][, file=sys.stdout])
Print object(s) to the stream file, separated by sep and followed by end. sep, end and file, if present, must be given as keyword arguments.
All non-keyword arguments are converted to strings like str() does and written to the stream, separated by sep and followed by end. Both sep andend must be strings; they can also be None, which means to use the default values. If no object is given, print() will just write end.
The file argument must be an object with a write(string) method; if it is not present or None, sys.stdout will be used. Output buffering is determined byfile. Use file.flush() to ensure, for instance, immediate appearance on a screen.
本文详细介绍了Python中的打印函数print的使用方法,包括如何将对象输出到指定流文件,使用sep和end参数自定义分隔符及结尾符,以及如何处理默认参数和输出缓冲等问题。

被折叠的 条评论
为什么被折叠?



