Shape Formula

Sometimes the formula depends on which shape you are dealing with: a square or a regular rectangle. Write a function area_or_perimeter that takes the sides l and w. If the sides are equal, return the area; otherwise, return the perimeter.

Примеры

Ввод
4, 4
Вывод
16
Ввод
6, 10
Вывод
32
Ввод
3, 3
Вывод
9

Нужно реализовать

def area_or_perimeter(l: int, w: int) -> int:

Теги

math
PostgreSQLv16

Le résultat de l'exécution du code s'affichera ici

Visible tests
1
Input
4, 4
Expected16
2
Input
6, 10
Expected32
3
Input
3, 3
Expected9
4
Input
1, 2
Expected6
5
Input
5, 5
Expected25
6
Input
-100, 4
Expected-192
Focus radio
Paused · SomaFM · Fluid