Issue 29664: zip() python 3 documentation not working at all ! (original) (raw)

this code from the python documentation itself not working!

x = [1, 2, 3] y = [4, 5, 6] zipped = zip(x, y)

this code is copied from the python 3 official documentation itself even though it is working for me I am using python 3.5.2 on ubuntu 16.04 LTS


TypeError Traceback (most recent call last) in () 6 x = [1, 2, 3] 7 y = [4, 5, 6] ----> 8 zip(x, y)

TypeError: 'tuple' object is not callable

Your example works for me.

x = [1, 2, 3] y = [4, 5, 6] zipped = zip(x, y) print(zipped) <zip object at 0xb6ff706c> print(list(zipped)) [(1, 4), (2, 5), (3, 6)]

I guess you have overridden the builtin function "zip" by setting the global variable "zip".

zip = (7, 8) zipped = zip(x, y) Traceback (most recent call last): File "", line 1, in TypeError: 'tuple' object is not callable