1.打印字符串
print("My name is %s" %("Alfred.Xue")) #输出效果: My name is Alfred.Xue
2.打印整数
print("I am %d years old." %(25)) #输出效果: I am 25 years old.
3.打印浮点数
print ("His height is %f m"%(1.70)) #输出效果: His height is 1.700000 m
原文:https://www.cnblogs.com/yanshuai0922/p/9852987.html