- 2
Please explain the code and its output
class Pizza: def__init__(self,toppings): self.toppings=toppings @staticmethod def validate_topping( topping): if topping=="pineapple": raise ValueError("No pineapple") else: return True ingredients=["cheese","onions","spam"] if all( Pizza.validate_topping(i) for I in range ingredients): pizza=Pizza(ingredients)
1 Respuesta
+ 3
Please don't ask generic question...
If you have a problem, describe it accuratly as possible, telling what point you don't understand ^^