Compare the Squares
Here you need to carefully compare two similar-looking but different values. The function difference_of_squares receives number and calculates both the square of the sum of the first number natural numbers and the sum of their squares. Return the difference: the square of the sum minus the sum of the squares.
Примеры
Ввод
1Вывод
0Ввод
5Вывод
170Ввод
10Вывод
2640Нужно реализовать
def difference_of_squares(number: 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
1Expected
02
Input
5Expected
1703
Input
10Expected
26404
Input
100Expected
251641505
Input
0Expected
06
Input
2Expected
4Focus radio
Paused · SomaFM · Fluid