We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Area Sum

The area of a rectangle is calculated by multiplying its height and width. For example, the area of a rectangle with a height of 3 and a width of 5 is:

3 * 5 = 15

Assignment

Complete the area_sum() function. It accepts a list of rectangles, where each rectangle is a dictionary that has the following structure:

rectangle: dict[str, int] = {"height": 5, "width": 6}

The function should calculate the area of each rectangle and return the sum of all the areas.