Double on Match
Sometimes a calculation rule changes when the input values match, which is a great way to practice if. Write a function sum_double that takes two integers a and b. Return their normal sum, but if the numbers are equal, return double that sum.
Примеры
Ввод
1, 2Вывод
3Ввод
3, 2Вывод
5Ввод
2, 2Вывод
8Нужно реализовать
def sum_double(a: int, b: int) -> int:
Теги
math
Jelentkezz be a beküldési előzmények megtekintéséhez
BejelentkezésJelentkezz be az MI-mentor használatához
BejelentkezésVisible tests
1
Input
1, 2Expected
32
Input
3, 2Expected
53
Input
2, 2Expected
84
Input
-1, 0Expected
-15
Input
5, 5Expected
206
Input
1000, 10Expected
1010Focus radio
Paused · SomaFM · Fluid