Python 3 教程
print() 方法用于打印輸出,最常見的一個函數(shù)。
在 Python3.3 版增加了 flush 關(guān)鍵字參數(shù)。
print 在 Python3.x 是一個函數(shù),但在 Python2.x 版本不是一個函數(shù),只是一個關(guān)鍵字。
以下是 print() 方法的語法:
print(*objects, sep=' ', end='n', file=sys.stdout, flush=False)
無。
以下展示了使用 print 函數(shù)的實例:
使用 flush 參數(shù)生成一個 Loading 的效果:
效果如下圖:
更多內(nèi)容參考:Python3 print 函數(shù)用法總結(jié)
其他擴展