Question: Create 4 classes extending from a base Drink class. Directions in the attached .py file. Using python 3.x to solve this problem. #Given the following

 Create 4 classes extending from a base Drink class. Directions in

Create 4 classes extending from a base Drink class. Directions in the attached .py file. Using python 3.x to solve this problem.

#Given the following Code: Eclass Drink (): def init (self, name, calories): se t . name name solf.empty calorics = calories/2 sell.healthy calories = calories/2 def drink (self): print("You drink "+self.name+" which provides:") print("In\t empty:"+str (self.empty calories)) print(" n\t healthy: "+str (self.healthy calories)) |# Write a Smoothie class that extends from Drink class # Override the nL function Lo only Lake calories and se L Lhe name to Smoo Lhe, #it should also distribute all the calories to healthy calories (Not half/half) # write a Soda class that extends from Drink class # Override the init function to only take calories and set the name to Soda, #it should also distribute all the calories to empty calories (Not half/half) # Write a DietSoda class that extends from Soda class # override the init function to not take any parameters, #but set the name to DietSoda and both calories to 0. # WrLe a VeganSmoo L hie class LhaL extends from Smoothie class # override the drink function so that it operates the same as before, #but adds a line to the end of the print: "and higher enlightenment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!