I made changes to make this code both python2 and python3 compatible. I replaced the iteritems with items - it doesn't do the same thing, but for very small lists (as the ones in this code) performance impact is insignificant. And of course, results are equal.
Also added list in front of zip to make in work in python3 (where zip returns a iterable ZipObject).
I made changes to make this code both python2 and python3 compatible. I replaced the
iteritems
withitems
- it doesn't do the same thing, but for very small lists (as the ones in this code) performance impact is insignificant. And of course, results are equal. Also added list in front ofzip
to make in work in python3 (where zip returns a iterableZipObject
).