Python格式化輸出——format

format OR % 提到Python中的格式化輸出方法,通常來講有如下兩種方式:python print('hello %s' % 'world') # hello world print('hello {}'.format('world')) # hello world 到底哪一種好呢,反正對我來講,用了.format()以後就不再想用%了。web format()不用理會數據類型,%s,%
相關文章
相關標籤/搜索