Describe a circle
Input
describe_shape("circle", 2)
Output
Circle(radius=2)
Circle.describe() returns the radius formatted into the string.
Full lesson preview
Define polymorphic describe() methods for different shapes so code can treat them uniformly.
Problem statement
Task
Examples
Input
describe_shape("circle", 2)
Output
Circle(radius=2)
Circle.describe() returns the radius formatted into the string.
Input format
Output format
Constraints
Samples
Input
describe_shape("rectangle", 3, 4)
Output
Rectangle(width=3,height=4)
Rectangle.describe() combines width and height in the expected format.