Chessboard Grains

In an old legend, one grain is placed on the first square of a chessboard, and each next square gets twice as many as the previous one. The function square receives a square number from 1 to 64 and returns how many grains are on that square. If the square number is outside this range, raise ValueError.

Примеры

Ввод
1
Вывод
1
Ввод
2
Вывод
2
Ввод
4
Вывод
8

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

def square(number: int) -> int:

Теги

math
PostgreSQLv16

Siia ilmub koodi käivituse tulemus

Visible tests
1
Input
1
Expected1
2
Input
2
Expected2
3
Input
4
Expected8
4
Input
16
Expected32768
5
Input
64
Expected9223372036854776000
Focus radio
Paused · SomaFM · Fluid