Jul-27-2018, 05:15 PM
Hi, I'm having a trouble with new Python 3.7 when use next code, I have got next raise Exception StopIteration, but I have not it when use 2.7.
thanks in advance.
1 2 3 4 5 6 7 8 9 10 |
def _zip( * args): iters = list ( map ( iter , args)) while iters: res = [ next (i) for i in iters] yield tuple (res) if __name__ = = '__main__' : s1, s2 = 'abc' , 'xyz123' print ( list (_zip(s1, s2))) |