出于某种原因,IDLE 不显示type
of tuple i
。知道这里有什么问题吗?
>>> d = {"a":"apple","b":"boy","c":"cat"}
>>> d
{'a': 'apple', 'b': 'boy', 'c': 'cat'}
>>> t = ((k,v) for k,v in d.items())
>>> t
<generator object <genexpr> at 0x0237C558>
>>> for i in t: print(i)
('a', 'apple')
('b', 'boy')
('c', 'cat')
>>> for i in t: print(type(i))
>>>