|
|
发表于 2013-11-28 09:50:41
|
显示全部楼层
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) Print objects 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 and end must be strings; they can also be None, which means to use the default values. If no objects are 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. Whether output is buffered is usually determined by file, but if the flush keyword argument is true, the stream is forcibly flushed.
Changed in version 3.3: Added the flush keyword argument.
end = ' '表示强调以空格结束,默认参数是end = '\n'。
第三讲有这道课后题吗? |
|