Search this site
Embedded Files
Skip to main content
Skip to navigation
How2Py
Home
Basics
Answers To Challenges
More Data Types
Answers to Challenges
Drawing
Answers to Challenges
Using Events with Turtle
Answers to Challenges
Desicions
Answers to Challenges
Loops
Answers to Challenges
Functions
Answers to Challenges
Classes
Answers to Challenges
More Modules
Answers to Challenges
Debugging Code
The Try ... Except Block
How To...
Make a Text Adventure
How2Py
Home
Basics
Answers To Challenges
More Data Types
Answers to Challenges
Drawing
Answers to Challenges
Using Events with Turtle
Answers to Challenges
Desicions
Answers to Challenges
Loops
Answers to Challenges
Functions
Answers to Challenges
Classes
Answers to Challenges
More Modules
Answers to Challenges
Debugging Code
The Try ... Except Block
How To...
Make a Text Adventure
More
Home
Basics
Answers To Challenges
More Data Types
Answers to Challenges
Drawing
Answers to Challenges
Using Events with Turtle
Answers to Challenges
Desicions
Answers to Challenges
Loops
Answers to Challenges
Functions
Answers to Challenges
Classes
Answers to Challenges
More Modules
Answers to Challenges
Debugging Code
The Try ... Except Block
How To...
Make a Text Adventure
Answers to Challenges
Create a Fruits class. It should inherit all of the properties from Food.
Add a .get_eaten() method to the Fruits class. It should print "Ack! You ate me!" when it's run.
Add a .quantity property to the Fruits class. It should be set automatically by the __init__ magic method.
Change the .get_eaten() method to accept (but not require) a quantity of the fruit to eat.
Create a Fruits class. It should inherit all of the properties from Food.
Add a .get_eaten() method to the Fruits class. It should print "Ack! You ate me!" when it's run.
Add a .quantity property to the Fruits class. It should be set automatically by the __init__ magic method.
Change the .get_eaten() method to accept (but not require) a quantity of the fruit to eat.
Google Sites
Report abuse
Page details
Page updated
Google Sites
Report abuse