Skip to content

Commit 1eae5dc

Browse files
Merge pull request prathimacode-hub#584 from pratimakush10/facts_added
Facts Generator added
2 parents a245680 + 5b6e64e commit 1eae5dc

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed

Diff for: BasicPythonScripts/Facts Generator/Images/Output.png

126 KB
Loading

Diff for: BasicPythonScripts/Facts Generator/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<b>This is the basic python program which generate interesting facts</b>
2+
<br>
3+
<b>Built with</b><br>
4+
-Python<br>
5+
<b>Module Needed</b><br>
6+
-randfacts<br>
7+
<b>Purpose</b>
8+
<br>
9+
The purpose of this script to get the random facts from python using randfacts module of python.
10+
<b>Aim</b><br>
11+
The aim of the program is to generate random facts using python module {randfacts}.<br>
12+
<b>Compilation Steps</b><br>
13+
<br>
14+
<b>Step 1:</b> Firstly import randfacts module of python.<br>
15+
<br>
16+
<b>Step 2:</b>Then take variable name {n} in which user give number how many facts user needed.<br>
17+
<br>
18+
<b>Step 3:</b>Then a for loop which produce {n} interesting facts simultaneously using the loop.<br>
19+
<br>
20+
<h4>Screenshot of the Python script</h4>
21+
Awesome_Python_Scripts/BasicPythonScripts/Facts Generator/Images/Output.png
22+
<br>
23+
<h4>Author</h4>
24+
<b>Pratima Kushwaha</b>
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#importing randfacts module of python
2+
import randfacts
3+
s=1
4+
#variable n define how many facts needed
5+
n = int(input('How many interesting facts yo need???\n'))
6+
7+
#for loop which give random facts simultaneously
8+
for i in range(n):
9+
x = randfacts.getFact(True)
10+
print(f'{s}..{x}')
11+
s=s+1

Diff for: BasicPythonScripts/Facts Generator/requirements.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<h3>Module Imported</h3>
2+
<hr>
3+
<b>1. randfacts</b>
4+
<h4>Setup instructions</h4>
5+
<hr>
6+
-->To install:randfacts<br>
7+
run: <b>pip install randfacts</b>

0 commit comments

Comments
 (0)