Hi, Suppose I wanted to manually iterate over a container, for example:
mylist = [1,2,3,4,5,6] it = iter(mylist) while True: print it it.next() In the example above, the print doesn't print the VALUE that the iterator currently represents, it prints the iterator itself. How can I get the value 'it' represents so I can either modify that value or print it? Thanks. PS: Yes, I know that the While loop is messy and I should be prepared to handle the StopIteration exception. However, if you guys can think of a better alternative than the while loop I'd really appreciate it. Thanks.
-- http://mail.python.org/mailman/listinfo/python-list