Result None the list(a) second time. Does anyone know about this?
None
list(a)
>>> test = {1: 2, 3: 4} >>> a= test.iterkeys() >>> list(a) **[1, 3]** >>> list(a) **[]** >>> list(a) []
iterkeys returns an iterator that, like any iterator, can only be iterated once.
iterkeys
list consumes the entire iterator, so the latter cannot supply more values, so subsequent lists are empty.
list