Question: Create a class called AppleBasket whose constructor accepts two inputs: ( 1 ) a string representing a color, and ( 2 ) a number representing
Create a class called AppleBasket whose constructor accepts two inputs: a string representing a color, and a number representing a quantity of apples. The constructor should initialize two instance variables: applecolor and applequantity. Write a class method called increase that increases the quantity by each time it is invoked. You should also write a str method for this class that returns a string of the format: "A basket of quantity goes herecolor goes here apples." eg "A basket of red apples." or "A basket of blue apples." Writing some test code that creates instances and assigns values to variables may help you solve this problem!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
