Programming, Python, Example, Object Oriented, Mastering.
size self.toppings = toppings self.base_price = 10 # Base price for a plain pizza def calculate_cost(self): toppings_cost = len(self.toppings) * 2 # Each topping costs $2 total_cost = self.base_price + toppings_cost return total_cost def display_details(self): print(f"Size: {self.size}, Toppings: