msg="I am "+"king" print(msg) print("I am %s of the %s" % ("tang","king"))#%s 字符串占位符 print("I am %s of age %s" % ("tang",[20,11]))#%s 字符串占位符 print("I am %s of the %d" % ("tang",1))#%d 整型占位符 #打印浮点数 print("I am %s of the mailes %.2f" % ("tang",1.12233))#%f 浮点型占位符 .2表示只取两位小数 #打印百分号 print("percent %.2f %%%d" % (1.12233,80))#%% print("I am %(name)s of the age %(age)d" % {'name':"tang","age":21})#字典键进行传值 print('root','x', '0','0',sep=":")