>>> d = {'x':34,'y':'fff','z':4.6}
>>> d['y'], len(d), d.items(), d.keys()
('fff', 3, [('y', 'fff'), ('x', 34), ('z', 4.5999999999999996)], ['y', 'x', 'z'])
>>> c = d.copy
>>> c
>>> d.has_key('x'), d.values()
(True, ['fff', 34, 4.5999999999999996])
>>> d
{'y': 'fff', 'x': 34, 'z': 4.5999999999999996}
>>> i=d.iteritems();i.next()
('y', 'fff')
>>> i=d.iterkeys();i.next()
'y'
>>> i=d.itervalues();i.next()
'fff'
>>> d.popitem()
('y', 'fff')
>>> d
{'x': 34, 'z': 4.5999999999999996}
>>>
>>> d['y'], len(d), d.items(), d.keys()
('fff', 3, [('y', 'fff'), ('x', 34), ('z', 4.5999999999999996)], ['y', 'x', 'z'])
>>> c = d.copy
>>> c
>>> d.has_key('x'), d.values()
(True, ['fff', 34, 4.5999999999999996])
>>> d
{'y': 'fff', 'x': 34, 'z': 4.5999999999999996}
>>> i=d.iteritems();i.next()
('y', 'fff')
>>> i=d.iterkeys();i.next()
'y'
>>> i=d.itervalues();i.next()
'fff'
>>> d.popitem()
('y', 'fff')
>>> d
{'x': 34, 'z': 4.5999999999999996}
>>>
Comments
Post a Comment