Refer to the following code and answer the questions on the right: 1 class Product: 2 store_name = "ProtoTop" 1. What will be the output if the following lines of code are executed after the last...


Using
PYTHON, help answer the questions on the right:




Refer to the following code and answer the questions on the right:<br>1 class Product:<br>2<br>store_name =
stocks_sold: self.stock -- stocks_sold 27 O b. Not enough stocks of Hopia for selling. 28 20 29 Oc. Not enough stocks of hopia for selling. 30 else: print(f"Not enough stocks of {self.name} for selling.") O d. An error will occur 31 32 O e. Not enough stocks of hopia for selling. 33 hopia = Product("Hopia", "food", 4, 100, 20) 20 "/>
Extracted text: Refer to the following code and answer the questions on the right: 1 class Product: 2 store_name = "ProtoTop" 1. What will be the output if the following lines of code are executed after the last line? 3 4 def _init_(self, name, category, price, stock, weight_in_grams): self.name = name hopia.sell(100) print(hopia.stock) self.description = self.category = category 8 self.price = price O 100 self.stock = stock O Not enough stocks of Hopia for selling. 100 10 self.weight_in_grams = weight_in_grams O Not enough stocks of Hopia for selling. 11 def change_name(self, new_name): self.name = new_name 12 O An error will occur 13 14 15 def change_description(self, new_description): 2. What will be the output if the following lines of 16 self.description = new_description are executed after the last line? 17 18 def change_category(self, new_category): hopia.sell(20) 19 self.category = new_category hopia.sell(20) hopia.sell(20) 20 21 def change_weight(self, new_weight_in_grams): hopia.sell(20) hopia.eat(20) 22 self.weight_in_grams = new_weight_in_grams 23 print(hopia.stock) def add_supplies(self, stocks_added): self.stock += stocks_added 24 25 O a. Not enough stocks of Hopia for selling. 26 def sell(self, stocks_sold): if self.stock > stocks_sold: self.stock -- stocks_sold 27 O b. Not enough stocks of Hopia for selling. 28 20 29 Oc. Not enough stocks of hopia for selling. 30 else: print(f"Not enough stocks of {self.name} for selling.") O d. An error will occur 31 32 O e. Not enough stocks of hopia for selling. 33 hopia = Product("Hopia", "food", 4, 100, 20) 20

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here