>>101977756
>>101977664
>>101976009
Largestral solved this problem for me :)
namegen.py
from faker import Faker
# Initialize the Faker generator
fake = Faker('en_GB', use_weighting=False) # Pick a country en_US, de_DE, ru_RU, fr_FR
# Function to generate a random full name
def generate_random_name(gender):
if gender.lower() == 'female':
first_name = fake.first_name_female()
elif gender.lower() == 'male':
first_name = fake.first_name_male()
else:
raise ValueError("Gender must be 'female' or 'male'")
surname = fake.last_name()
return first_name, surname
# Generate and print a random female name
first_name, surname = generate_random_name('female')
print(f"Random Female Name: {first_name} {surname}")
# Generate and print a random male name
first_name, surname = generate_random_name('male')
print(f"Random Male Name: {first_name} {surname}")
Learn to prompt.