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

python:print和format

系統 2248 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條評論
主站蜘蛛池模板: 玛沁县| 德兴市| 普定县| 孝义市| 壤塘县| 伊宁市| 建湖县| 宁陵县| 安义县| 额尔古纳市| 凭祥市| 揭东县| 郎溪县| 永泰县| 墨竹工卡县| 阜阳市| 运城市| 洛浦县| 阳原县| 岚皋县| 于都县| 尼玛县| 静安区| 新津县| 香港| 宁武县| 田林县| 青河县| 新沂市| 句容市| 塔河县| 开封县| 开化县| 吉林市| 德惠市| 河北区| 宣威市| 红安县| 武宁县| 阳曲县| 阿瓦提县|