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 OutputSize: 12 ouncesSize: 12 ounces Sugar: 36 grams
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here