Python格式化输出——format

format OR % 提到Python中的格式化输出方法,通常来讲有如下两种方式:python print('hello %s' % 'world') # hello world print('hello {}'.format('world')) # hello world 到底哪一种好呢,反正对我来讲,用了.format()以后就不再想用%了。web format()不用理会数据类型,%s,%
相关文章
相关标签/搜索