adplus-dvertising
frame-decoration

Question

What does the following piece of code do?
print(list(zip((1,2,3),('a'),('xxx','yyy'))))
print(list(zip((2,4),('b','c'),('yy','xx'))))

a.

[(1,2,3),(‘a’),(‘xxx’,’yyy’)].
[(2,4),(‘b’,’c’),(‘yy’,’xx’)].

b.

[(1, ‘a’, ‘xxx’),(2,’ ‘,’yyy’),(3,’ ‘,’ ‘)].
[(2, ‘b’, ‘yy’), (4, ‘c’, ‘xx’)].

c.

Syntax error.

d.

[(1, ‘a’, ‘xxx’)].
[(2, ‘b’, ‘yy’), (4, ‘c’, ‘xx’)].

Posted under Python

Answer: (d).[(1, ‘a’, ‘xxx’)].
[(2, ‘b’, ‘yy’), (4, ‘c’, ‘xx’)].

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What does the following piece of code do?