class KaffeLatte: def __init__(self, ant_espressoshots): self._antall_espressoshots = ant_espressoshots def hent_antall_espressoshots(self): return self._antall_espressoshots def __str__(self): return "Kaffelatte med "+ str(self._antall_espressoshots) + " espressoshots." def __eq__(self, annen): return self._antall_espressoshots == annen._antall_espressoshots def hovedprogram(): bestillinger = [] for i in range(5): dobbel_latte = KaffeLatte(2) bestillinger.append(dobbel_latte) for bestilling in bestillinger: print(bestilling) for i in range(len(bestillinger) - 1): print(bestillinger[i] == bestillinger[i+1]) for i in range(len(bestillinger) - 1): print(bestillinger[i] is not bestillinger[i+1]) hovedprogram()