0

Just starting to learn Python and noticed the following behavior when using zip with dictionaries.

print(list(zip({4,5,6}, {7,8,9})))

returns: [(4, 8), (5, 9), (6, 7)]

instead of the expected: [(4, 7), (5, 8), (6, 9)]

Why is this ordering the values in the second dictionary differently than input?

Pete Maroun
  • 2,045
  • 2
  • 18
  • 27

0 Answers0