What is the output of the following? a = (1, 2, 3) b = (1, 2, 3) print(a == b, a is b)

Python Developer Medium

Python Developer — Medium

What is the output of the following? a = (1, 2, 3) b = (1, 2, 3) print(a == b, a is b)

Key points

  • The '==' operator checks if the values are equal
  • The 'is' operator checks if the objects are the same
  • In this case, a and b have the same values but are different objects

Ready to go further?

Related questions