Question: Create a file named game.py and define a class named Game that inherits from InventoryItem. The Game class has one additional public instance variables, a

Create a file named game.py and define a class named Game that inherits from InventoryItem. The Game class has one additional public instance variables, a string called upc.
Just as you did with the Book class, override the superclass __init__, get_item_input, and __str__ methods to perform appropriate actions for this class.
Make sure the __init__ method sets the category for this object to be "Game".
Make sure your get_item_input method does data validation to ensure the UPC entered by the user is a string with 12 digits.
If this object is created directly, here's what it should look like:
Monopoly
Count: 50, Cost: 12.95
Category: Game
UPC: 098765432121
Wherever possible, your program should call the super() function to access methods from the base class to avoid copying code from the base class module

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 Programming Questions!