Write a python script to generate a bunch of fake names and then insert them into a CSV…
- User
Write a python script to generate a bunch of fake names and then insert them into a CSV file
Assistant
Here is a Python script that generates fake names and saves them to a CSV file:
import csv import random import string num_names = 100 first_names = ['John', 'Jane', 'Bob', 'Mary', 'Tom', 'Emma', 'Michael', 'Sarah', 'David', 'Laura'] last_names = ['Smith', 'Jones', 'Taylor', 'Brown', 'Williams', 'Wilson', 'Johnson', 'Lewis', 'Jackson', 'White'] fake_names = [] for i in range(num_names): first = random.choice(first_names) last = random.choice(last_names) name = first + " " + last fake_names.append(name) with open('fake_names.csv', 'w', newline='') as csvfile: writer = csv.writer(csvfile) writer.writerow(['Name']) for name in fake_names: writer.writerow([name])
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.