Skip to content

Commit 4e6d766

Browse files
authored
Merge pull request #88 from harshareddy794/generate_fake_names
Generate fake names
2 parents cde029c + 22b7f5d commit 4e6d766

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

Python/fake_name_generator/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
3+
## Introduction
4+
This is the python script to generate fake names using faker library
5+
6+
## Setup
7+
8+
1. Open terminal/cmd.
9+
10+
2. Navigate to folder where you downloaded the faker script.
11+
12+
3. Enter the following command.
13+
14+
pip3 install -r"requirements.txt"
15+
16+
4. After all the required libraries are installed sucessfully we can run script.
17+
18+
19+
## Using script
20+
* `` python app.py ``
21+
22+
* Then enter number of names that you want to generate
23+
24+
25+
## Output
26+
27+
![Screenshot (211)](https://user-images.githubusercontent.com/48166328/96716521-c420d000-13c2-11eb-8ff0-0fc83b5ef4fd.png)
28+
29+

Python/fake_name_generator/app.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Importing faker library that helps us in generating fake data
2+
from faker import Faker
3+
4+
# Creating instance for faker library
5+
fake = Faker()
6+
7+
# Tanking number of names that user want to generate as input
8+
n=int(input("Enter how many name you want to generate: "))
9+
10+
# We will be using for loop to generate fake names
11+
for i in range(n):
12+
print(fake.name())
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
faker

0 commit comments

Comments
 (0)