Both dimensions provided
Input
rectangle_area(2, 3)
Output
6
A Rectangle with width 2 and height 3 yields area 6.
Full lesson preview
Learn to rely on default __init__ parameter values when constructing objects.
Problem statement
Task
Examples
Input
rectangle_area(2, 3)
Output
6
A Rectangle with width 2 and height 3 yields area 6.
Input format
Output format
Constraints
Samples
Input
rectangle_area(None, 4)
Output
4
Width uses default 1, height 4 => area 4.