First of all, you need to insal Faker library, then need to execute the following python code.
Faker is a Python package that generates fake data for you.
Generating random names for baby girl and baby boy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from faker import Faker fake = Faker('en_US') # You can adjust the locale to 'ur_PK' for Pakistani names # Generate 500 boys' names boys_names = [fake.first_name_male() for _ in range(500)] # Generate 500 girls' names girls_names = [fake.first_name_female() for _ in range(
500)] # Combine the lists all_names = boys_names + girls_names # Shuffle the list to make it more random import random random.shuffle(all_names) # Print the first 10 names as a sample print(all_names[:10]) |
Generating random names for girls
1 2 3 4 5 6 7 8 9 |
from faker import
Faker fake = Faker('ur_PK') # Set the locale to 'ur_PK' for Pakistani names # Generate 1000 girls' names girls_names = [fake.first_name_female() for _ in range(1000)] # Print the first 10 names as a sample print(girls_names[:10]) |
Generating random names for Boys
1 2 3 4 5 6 7 8 9 |
from faker import Faker fake = Faker('ur_PK') # Set the locale to 'ur_PK' for Pakistani names # Generate 1000 boys' names boys_names = [fake.first_name_male() for _ in range(1000)] # Print the first 10 names as a sample print(boys_names[:10]) |