What is the output of the following snippet?

  • Post author:
  • Post category:Q&A
  • Reading time:1 min read
  • Post last modified:March 15, 2025

What is the output of the following snippet?

x = 1
y = 2
z = x
x = y
y = z
print (x, y)
  • 1 1
  • 1 2
  • 2 2
  • 2 1
    Options 4 is the answer