__eq__, and two objects with the same value are made.
class Coin:
def __init__(self, value):
self.value = value
def __eq__(self, other):
return self.value == other.value
a = Coin(5)
b = Coin(5)
Which of these expressions are True? Choose every correct option.One or more options are correct. Tick all the correct ones: a wrong option costs marks, and a part-right answer earns part of the marks.
Log in to join the discussion.
Loading…