0

I have the below code

>>> ",".join({"x": 1, "y": 2})
 'y,x'

>>> list({"x": 1, "y": 2})
 ['y', 'x']

On what logic is the key printed in the order "y,x" and not "x,y". I tried with multiple values in the dictionary but unable to conclude a logic.

ambikanair
  • 4,004
  • 11
  • 43
  • 83

0 Answers0