Forbidden Sum
Sometimes a calculation has a special range that must be handled differently from the usual rule. Write a function sorta_sum that takes two numbers a and b and calculates their sum. If the result is from 10 to 19 inclusive, return 20; otherwise, return the normal sum.
Примеры
Ввод
3, 4Вывод
7Ввод
9, 4Вывод
20Ввод
10, 11Вывод
21Нужно реализовать
def sorta_sum(a: int, b: int) -> int:
Теги
math
Kirjaudu sisään nähdäksesi palautushistorian
Kirjaudu sisäänKirjaudu sisään käyttääksesi tekoälymentoria
Kirjaudu sisäänVisible tests
1
Input
3, 4Expected
72
Input
9, 4Expected
203
Input
10, 11Expected
214
Input
5, 5Expected
205
Input
0, 0Expected
06
Input
9, 10Expected
20Focus radio
Paused · SomaFM · Fluid