equals-operator

What's the meaning of "(1,) == 1," in Python?

What's the meaning of "(1,) == 1," in Python? Question: I’m testing the tuple structure, and I found it’s strange when I use the == operator like: >>> (1,) == 1, Out: (False,) When I assign these two expressions to a variable, the result is true: >>> a = (1,) >>> b = 1, >>> …

Total answers: 3