<span class="hljs-title" style="color: #7285b7;">Ice_coke<span class="hljs-params" style="color: #ffc58f;">(metaclass=ABCMeta):
<span class="hljs-decorator">@abstractmethod
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">drink<span class="hljs-params" style="color: #ffc58f;">(self):
<span class="hljs-keyword" style="color: #ebbbff;">pass
<span class="hljs-class"><span class="hljs-keyword" style="color: #ebbbff;">class <span class="hljs-title" style="color: #7285b7;">Ordinary_coke<span class="hljs-params" style="color: #ffc58f;">(metaclass=ABCMeta):
<span class="hljs-decorator">@abstractmethod
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">drink<span class="hljs-params" style="color: #ffc58f;">(self):
<span class="hljs-keyword" style="color: #ebbbff;">pass
<span class="hljs-class"><span class="hljs-keyword" style="color: #ebbbff;">class <span class="hljs-title" style="color: #7285b7;">Coca_ice<span class="hljs-params" style="color: #ffc58f;">(Ice_coke):
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">drink<span class="hljs-params" style="color: #ffc58f;">(self):
print(<span class="hljs-string" style="color: #d1f1a9;">'drink Coca-ice-Cola')
<span class="hljs-class"><span class="hljs-keyword" style="color: #ebbbff;">class <span class="hljs-title" style="color: #7285b7;">Pepsi_ice<span class="hljs-params" style="color: #ffc58f;">(Ice_coke):
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">drink<span class="hljs-params" style="color: #ffc58f;">(self):
print(<span class="hljs-string" style="color: #d1f1a9;">'drink Pepsi-ice-Cola')
<span class="hljs-class"><span class="hljs-keyword" style="color: #ebbbff;">class <span class="hljs-title" style="color: #7285b7;">Coca_ordinary<span class="hljs-params" style="color: #ffc58f;">(Ordinary_coke):
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">drink<span class="hljs-params" style="color: #ffc58f;">(self):
print(<span class="hljs-string" style="color: #d1f1a9;">'drink Coca-ordinary-Cola')
<span class="hljs-class"><span class="hljs-keyword" style="color: #ebbbff;">class <span class="hljs-title" style="color: #7285b7;">Pepsi_ordinary<span class="hljs-params" style="color: #ffc58f;">(Ordinary_coke):
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">drink<span class="hljs-params" style="color: #ffc58f;">(self):
print(<span class="hljs-string" style="color: #d1f1a9;">'drink Pepsi-ordinary-Cola')
<span class="hljs-class"><span class="hljs-keyword" style="color: #ebbbff;">class <span class="hljs-title" style="color: #7285b7;">Fast_food_restaurant<span class="hljs-params" style="color: #ffc58f;">(metaclass=ABCMeta):
<span class="hljs-decorator">@abstractmethod
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">make_ice_coke<span class="hljs-params" style="color: #ffc58f;">(self):
<span class="hljs-keyword" style="color: #ebbbff;">pass
<span class="hljs-decorator">@abstractmethod</span>
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def</span> <span class="hljs-title" style="color: #7285b7;">make_ordinary_coke</span><span class="hljs-params" style="color: #ffc58f;">(self)</span>:</span>
<span class="hljs-keyword" style="color: #ebbbff;">pass</span>
<span class="hljs-class"><span class="hljs-keyword" style="color: #ebbbff;">class <span class="hljs-title" style="color: #7285b7;">Coca_produce<span class="hljs-params" style="color: #ffc58f;">(Fast_food_restaurant):
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">make_ice_coke<span class="hljs-params" style="color: #ffc58f;">(self):
<span class="hljs-keyword" style="color: #ebbbff;">return Coca_ice()
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">make_ordinary_coke<span class="hljs-params" style="color: #ffc58f;">(self):
<span class="hljs-keyword" style="color: #ebbbff;">return Coca_ordinary()
<span class="hljs-class"><span class="hljs-keyword" style="color: #ebbbff;">class <span class="hljs-title" style="color: #7285b7;">Pepsi_produce<span class="hljs-params" style="color: #ffc58f;">(Fast_food_restaurant):
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">make_ice_coke<span class="hljs-params" style="color: #ffc58f;">(self):
<span class="hljs-keyword" style="color: #ebbbff;">return Pepsi_ice()
<span class="hljs-function" style="color: #bbdaff;"><span class="hljs-keyword" style="color: #ebbbff;">def <span class="hljs-title" style="color: #7285b7;">make_ordinary_coke<span class="hljs-params" style="color: #ffc58f;">(self):
<span class="hljs-keyword" style="color: #ebbbff;">return Pepsi_ordinary()
KCD=Coca_produce()
coke=KCD.make_ice_coke()
coke.drink()<span class="hljs-comment" style="color: #7285b7;">#drink Coca-ice-Cola