次のクラスに関する説明で、誤っているものはどれか。 ------------------------------- class Book: def __init__(self, title, price): self.title = title self.price = price def __repr__(self): return f'{self.title}' def __len__(self): return len(self.title) def __eq__(self, other): return self.price == other.price ------------------------------- インスタンスは次の2つを生成したものとする。 sample1 = Book('Python', 500) sample2 = Book('Java', 500)
選択 1
__init__()メソッドは特殊メソッドの1つである。
選択 2
「print(sample1)」を実行すると「Python」が返る。
選択 3
「len(sample2)」を実行すると「4」が返る。
選択 4
「sample1 == sample2」を実行すると「False」が返る。