如何获取键值的原始字符串?
dictionary = {'key': ['value']}
print(dictionary.get('key'))
>>> ['value']
如何获取'value'
而不是['value']
?
答案 0 :(得分:0)
dictionary = {'key': ['value']}
print(dictionary.get('key')[0])
答案 1 :(得分:0)
试试这个:
dictionary = {'key': ['value']}
print(dictionary.get('key'))[0]
输出:
value
[Finished in 0.0s]