W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
python_ref_string_format_2.py:
#named indexes: txt1 = "My name is {fname}, I'm {age}".format(fname = "Bill", age = 63) #numbered indexes: txt2 = "My name is {0}, I'm {1}".format("Bill",63) #empty placeholders: txt3 = "My name is {}, I'm {}".format("Bill",63) print(txt1) print(txt2) print(txt3)