Problem
Given a natural number number and an exponent exponent, write a function solution that returns the result of raising number to the power of exponent.
Constraints
numberandexponentare natural numbers between 1 and 9 inclusive.
Test Case
| Test Case Number | number | exponent | return |
|---|---|---|---|
| 1 | 2 | 3 | 8 |
| 2 | 5 | 2 | 25 |
| 3 | 9 | 1 | 9 |
Explanation for Test Case 1
- When
number = 2andexponent = 3, the result is2^3 = 8.
Explanation for Test Case 2
- When
number = 5andexponent = 2, the result is5^2 = 25.
Explanation for Test Case 3
- When
number = 9andexponent = 1, the result is9^1 = 9.