【发布时间】:2018-02-14 18:51:33
【问题描述】:
考虑以下字典:
dic1 = {1:'string', '1': 'int'}
让我们应用字符串格式:
print("the value is {0[1]}".format(dic1))
result --> the value is string
但是我怎样才能得到 'the value is int' 结果呢?
【问题讨论】:
标签: python dictionary string-formatting field-names