On 12/9/2013 05:10, zubair alam wrote:
> class PizzaShop(): pizza_stock =
> 10 def get_pizza(self): while
> PizzaShop.pizza_stock: PizzaShop.pizza_stock -=
> 1 yield "take yours pizza order, total pizzas left
> {}".format(PizzaShop.pizza_stock)
> mypizza_sho
> Date: Wed, 11 Sep 2013 18:10:18 +0530
> From: zubair alam
> To: tutor
> Subject: [Tutor] class data member and objects of class in python
> Message-ID:
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> i am learning how a __class__ data member behaves in python as compared to
> st
On 12/09/13 10:10, zubair alam wrote:
class PizzaShop():
pizza_stock = 10
def get_pizza(self):
while PizzaShop.pizza_stock:
PizzaShop.pizza_stock -= 1
yield "take yours pizza order, total pizzas left
{}".format(PizzaShop.pizza_stock)
mypizza_shop = Pi
class PizzaShop():
pizza_stock = 10
def get_pizza(self):
while PizzaShop.pizza_stock:
PizzaShop.pizza_stock -= 1
yield "take yours pizza order, total pizzas left
{}".format(PizzaShop.pizza_stock)
mypizza_shop = PizzaShop()
pizza_order = mypizza_shop.get_pizz
> i am learning how a __class__ data member behaves in python as
> compared to static data member in java [...]
The error is not related to class variables. Also could you elaborate on
what you intended to find out with this snippet?
> class PizzaShop():
> pizza_stock = 10
>
> def get_pi