Stop at Thirteen

Here, the number 13 works like a stop signal: everything after it no longer counts. Write a function lucky_sum that takes three numbers a, b, and c. Add the numbers from left to right, but if you meet 13, skip it and all values after it.

Примеры

Ввод
1, 2, 3
Вывод
6
Ввод
1, 2, 13
Вывод
3
Ввод
1, 13, 3
Вывод
1

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

def lucky_sum(a: int, b: int, c: int) -> int:

Теги

math
PostgreSQLv16

Taispeánfar toradh do chóid anseo

Visible tests
1
Input
1, 2, 3
Expected6
2
Input
1, 2, 13
Expected3
3
Input
1, 13, 3
Expected1
4
Input
13, 2, 3
Expected0
5
Input
13, 13, 2
Expected0
6
Input
9, 4, 13
Expected13
Focus radio
Paused · SomaFM · Fluid