摘要:
#format拼接字符串,format()内的参数必须为可迭代的对象p1="i am {2},age {1},{0}".format("seven",18,'alex') print(tp1) tp1="i am {1},age {1}".format("seven",18,'alex')#按照元祖下标取值 print(tp1) tp1="i am {name},age {age},r... 阅读全文
摘要:
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 整型占位符 #打印浮... 阅读全文