Skip Teen Values
Sometimes values need to be filtered before a total is calculated, such as temporary discounts, errors, or special codes. Write a function no_teen_sum that takes three numbers a, b, and c and returns their sum, but treats numbers from 13 to 19 inclusive as 0. The exceptions are 15 and 16: add them as normal numbers.
Примеры
Ввод
1, 2, 3Вывод
6Ввод
2, 13, 1Вывод
3Ввод
2, 1, 14Вывод
3Нужно реализовать
def no_teen_sum(a: int, b: int, c: int) -> int:
Теги
math
Inicia sesión para ver tu historial de envíos
Iniciar sesiónInicia sesión para usar el AI Mentor
Iniciar sesiónVisible tests
1
Input
1, 2, 3Expected
62
Input
2, 13, 1Expected
33
Input
2, 1, 14Expected
34
Input
2, 1, 15Expected
185
Input
2, 1, 16Expected
196
Input
6, 17, 18Expected
6Focus radio
Paused · SomaFM · Fluid