PYTHON PROGRAMMING 1) Create a class Drink with the attribute size. 2) Create a Drink print method that prints the size in ounces. 3) Create a class Soda which inherits from Drink. 4) Soda has an...



PYTHON PROGRAMMING


1) Create a class Drink with the attribute size.
2) Create a Drink print method that prints the size in ounces.
3) Create a class Soda which inherits from Drink.
4) Soda has an attribute sugar.
5) In Soda override the Drink print method to also print sugar in grams.
6) Instantiate two objects, one of type Drink and one of type Soda.
7) Call the print functions for each object.





Example Output

Size: 12 ounces
Size: 12 ounces  Sugar: 36 grams



Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here