日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

python:print和format

系統 2133 0

查詢幫助:
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

            
          

print 打印多值以逗號分隔,分隔符默認是空格(sep=‘ ’),新行符是‘\n’

            
              print(5,6,sep='>>')
	5>>6

            
          

            
              print(5,6,sep='>>',end='---')
print(8)
	5>>6---8

            
          

{}代表format中的值,{0}代表第一個

            
              print(' {}	{}aa{}'.format(1,2,3)) 
	1	2aa3


print(' {2}	{2}aa{2}'.format(1,2,3))
    3	3aa3

            
          


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 友谊县| 缙云县| 宣武区| 科尔| 麟游县| 彭泽县| 临夏县| 三河市| 台北市| 定日县| 洪湖市| 鄯善县| 三穗县| 潼南县| 伊春市| 浠水县| 寿阳县| 玉林市| 金昌市| 杭锦后旗| 巴南区| 揭阳市| 文安县| 九龙城区| 赤壁市| 仙游县| 韶关市| 东兴市| 丹寨县| 孟州市| 治县。| 池州市| 抚松县| 庆元县| 玛多县| 洞口县| 定边县| 咸宁市| 贵德县| 富裕县| 易门县|