Python如何格式化输出
1、格式化输出就是以想要的格式输出。Python中有三种格式化输出方式。分别是 % format {}

3、第二种格式化输出方式是formatname1 = "aahha" # 衡痕贤伎str ---> %sage = 13 # intlong1 = 178.89 # floatprint("名字{}".format(name1))print("年龄{}".format(age))print("名字{}年龄{}".format(name1,age))print("名字{0}年龄{1}".format(name1,age))print("年龄{1}名字{0}".format(name1,age))结果名字aahha年龄13名字aahha年龄13名字aahha年龄13年龄13名字aahha
