easy +5 pts

Area of Rectangle

Compute the area of a rectangle from its width and height.

Write a function `rectangle_area(width, height)` that returns the area of a rectangle. The area is calculated as `width * height`. The inputs will always be non-negative integers or floats. The function must return the exact product as a number (int or float).

Constraints

- 0 <= width, height <= 10^9 - Inputs are int or float. - The result may be a float if either input is a float.

Example

>>> rectangle_area(5, 4)
20
>>> rectangle_area(3.5, 2)
7.0
>>> rectangle_area(0, 10)
0
5 points ~5 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Use the multiplication operator `*`.
The function should accept two arguments and return a single value.
No need to convert types; just multiply the inputs directly.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.