我以为list()返还的是str,结果看了下type, 是list
tuple()的type 是 tuple
tuple就不是str吗
==============================================================
a = {'a' : '1', 'b' : '2'}
print('字典的值为: %s' % list(a.values()))
print("字典的值为: %s" % str(tuple(a.values())))
b = list(a.values())
c = tuple(a.values())
print(type(b))
print(type(c))
结果:==================================
字典的值为: ['1', '2']
字典的值为: ('1', '2')
<class 'list'>
<class 'tuple'>
[此贴子已经被作者于2019-11-17 01:16编辑过]