0

I can't understand this can anybody else explain how this works?

class Pizza: def __init__(self, toppings): self.toppings = toppings self._pineapple_allowed = False @property def pineapple_allowed(self): return self._pineapple_allowed @pineapple_allowed.setter def pineapple_allowed(self, value): if value: password = input("Enter the password: ") if password == "Sw0rdf1sh!": self._pineapple_allowed = value else: raise ValueError("Alert! Intruder!") pizza = Pizza(["cheese", "tomato"]) print(pizza.pineapple_allowed) pizza.pineapple_allowed = True print(pizza.pineapple_allowed) ________________________________________________________ I am slowly looking over every part I could understand till one point it just feels like they keep adding these lines with crazy syntax and stuff...

15th Oct 2019, 4:20 PM
GD cheerios YT
GD cheerios YT - avatar
4 Answers
+ 1
Maybe you can try search for videos covering that subject? if you're not comfortable learning by reading.
15th Oct 2019, 5:12 PM
Ipang
+ 2
Ok got it
15th Oct 2019, 5:26 PM
GD cheerios YT
GD cheerios YT - avatar
0
Yeah those don't make sense to me I have adhd and all that good stuff and I'm not a read learner
15th Oct 2019, 4:31 PM
GD cheerios YT
GD cheerios YT - avatar