Range Total
Imagine you need to quickly add all numbers between two marks on a number line. Write a function get_sum that takes two integers a and b in any order. Return the sum of all integers from the smaller number to the larger one, inclusive; if the numbers are equal, return that number.
Примеры
Ввод
1, 0Вывод
1Ввод
1, 2Вывод
3Ввод
0, 1Вывод
1Нужно реализовать
def get_sum(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, 0Expected
12
Input
1, 2Expected
33
Input
0, 1Expected
14
Input
1, 1Expected
15
Input
-1, 0Expected
-16
Input
2, 2Expected
2Focus radio
Paused · SomaFM · Fluid