Programming, Python, Example, Object Oriented, Mastering.
["Pepperoni", "Mushrooms", "Extra Cheese"]) # Using instance methods print(my_pizza.calculate_cost()) # Output: 18 my_pizza.display_details() # Output: Size: Medium, Toppings: Pepperoni, Mushrooms, Extra Cheese Class Methods Let’s create a class method to offer a special discount on large pizzas.