Raise to Power

A power tells how many times a number should be multiplied by itself. Write a function power that computes base^exp, where exp is a non-negative integer. If exp = 0, the result is always 1, including the 0^0 case for this function.

Примеры

Ввод
2, 10
Вывод
1024
Ввод
3, 0
Вывод
1
Ввод
5, 3
Вывод
125

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

def power(base: int, exp: int) -> int:

Теги

mathrecursion
PostgreSQLv16

Tukaj bo rezultat izvajanja kode

Visible tests
1
Input
2, 10
Expected1024
2
Input
3, 0
Expected1
3
Input
5, 3
Expected125
4
Input
0, 0
Expected1
5
Input
10, 4
Expected10000
6
Input
2, 0
Expected1
Focus radio
Paused · SomaFM · Fluid