print带参数格式


string_1 = "Camelot"
string_2 = "place"
print("float:%lf. int:%d string:%s." % (3.14,123, string_2))

print("I am a {type}".format(type=11.1))
my_name = "Michael"
print("Hello, my name is {name}".format(name=my_name))

原文地址:https://www.cnblogs.com/jxgapyw/p/5115510.html