Question: Python program: Construct a base class named shape that will maintain common shape information such as location, fill color, etc. The shape class should have
Python program:
Construct a base class named shape that will maintain common "shape" information such as location, fill color, etc. The shape class should have instance variables for the x and y location of the shape (type int), the fill color (type str) and a boolean indicating if the shape should be filled or not. The location should default to 0,0. The fill color should default to "" (Null string) and filled should default to False. Provide the following shape methods:
setFillcolor(str) : Mutator to set the fill color to the value of the string argument
setFilled(bool) : Mutator to set the filled boolean to the value of the boolean argument
isFilled() : Accessor that will return the value of the filled instance variable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
