Skip to content

Commit d2da513

Browse files
committed
random-number page added
1 parent ead7ca3 commit d2da513

File tree

4 files changed

+51
-8
lines changed

4 files changed

+51
-8
lines changed

Easy-ones/Math-Power.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
## 1.2: Math Power
33

44
**S-1: The problem**
5-
65
Take two numbers from the users. Calculate the result of second number power of the first number.
76

87
<details>
@@ -42,5 +41,8 @@ print('Your result is: ', result)
4241
**[Try It:](/#)**
4342

4443
&nbsp;
45-
###### tags: `programmig-hero` `python` `float` `int`
44+
[![Next Page](../assets/next-button.png)](Random-Number.md)
45+
&nbsp;
46+
47+
###### tags: `programmig-hero` `python` `float` `int` `math`
4648

Easy-ones/Random-Number.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
## 1.3: Create a random number
3+
4+
**S-1: The problem**
5+
Create a random number between 0 to 10
6+
7+
<details>
8+
<summary><b>S-2: Click Here For Show Hints</b></summary>
9+
<p>To create a random number, you have to import a built-in library named random. And then you can call the randint method on it</p>
10+
</details>
11+
<br>
12+
13+
##### result = 4**3
14+
15+
16+
#### S-3: Solution
17+
18+
```python
19+
import random
20+
21+
random_num = random.randint(0,10)
22+
print(random_num)
23+
```
24+
25+
**[Try It:](/#)**
26+
&nbsp;
27+
28+
#### S-4: Quiz
29+
How will you generate a random integer number?
30+
31+
1. math.random
32+
2. math.randint
33+
3. random.randomint
34+
35+
**The answer is: 2**
36+
37+
*S-5: Take Away*
38+
39+
Use math.randomint to get a random integer.
40+
41+
&nbsp;
42+
[![Next Page](../assets/next-button.png)](#)
43+
&nbsp;
44+
45+
###### tags: `programmig-hero` `python` `float` `int` `math`

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
### 1.1: User input to Number
55

66
**S-1: The problem**
7-
87
Take two inputs from the user. One will be an integer. The other will be a float number. Then multiply them to display the output.
98

109
<details>
@@ -41,11 +40,9 @@ print('Your result is: ', result)
4140
**[Try It:](/#)**
4241
&nbsp;
4342
#### S-5: Going Forward
44-
4543
Going forward, we will write input and conversion in one line.
4644

4745
#### S-6: Quiz
48-
4946
Which one is used to convert string to a number?
5047

5148

@@ -60,7 +57,6 @@ Which one is used to convert string to a number?
6057

6158
Use int or float to convert user input to a number.
6259
&nbsp;
60+
[![Next Page](assets/next-button.png)](/Easy-ones/Math-Power.md)
61+
&nbsp;
6362
###### tags: `programmig-hero` `python` `float` `int`
64-
65-
66-
[![Next Page](assets/next-button.png)](/Easy-ones/Math-Power.md)

assets/next-button.png

290 Bytes
Loading

0 commit comments

Comments
 (0)