You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Take two numbers from the users. Calculate the result of second number power of the first number.
7
+
8
+
<details>
9
+
<summary><b>S-2: Click Here For Show Hints</b></summary>
10
+
<p>To power, you will need to use two asterisks symbols (two multiplication symbols). For example 4 to the power 3 will be</p>
11
+
</details>
12
+
<br>
13
+
14
+
**result = 4**3**
15
+
16
+
17
+
#### S-3: Solution
18
+
19
+
```python
20
+
base_num =int(input('Give me the base number: '))
21
+
power_num =int(input('Give me the power number: '))
22
+
result = base_num ** power_num
23
+
print('Your result is: ', result)
24
+
```
25
+
26
+
**[Try It:](/#)**
27
+
28
+
#### S-4: Think Different
29
+
Python has a built-in function named pow [blue]. The pow is a short form of the word power. And you can pass 2 numbers to the pow function. It will give you the second number as a power of the first number.
30
+
31
+
32
+
#### S-5: Alternative Solution
33
+
Python has a built-in function named pow [blue]. The pow is a short form of the word power. And you can pass 2 numbers to the pow function. It will give you the second number as a power of the first number.
34
+
35
+
```python
36
+
base_num =int(input('Give me the base number: '))
37
+
power_num =int(input('Give me the power number: '))
0 commit comments