
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
보고 계신 화면 전체를 캡처해 주시면, 튜터님들이 빠르게 상황을 이해

할 수 있어요.
name = ''.join(random.choices(string.ascii_uppercase + string.ascii_lowercase, k=10))
age = random.randint(18, 70)
email = f"{name.lower()}@example.com"
login_count = random.randint(1, 100)
purchase_count = random.randint(1, 50)
total_purchase_amount = round(random.uniform(10.0, 1000.0), 2)
customers.append([name, age, email, login_count, purchase_count, total_purchase_amount])
return customers
# 엑셀 파일 생성 함수
def create_excel_file(filename, customers):
workbook = openpyxl.Workbook()
sheet = workbook.active
sheet.title = 'Customers'
# 헤더 추가
headers = ['name', 'age', 'e-mail', 'login count', 'purchase count', 'total purchase amount']
sheet.append(headers)
# 고객 데이터 추가
for customer in customers:
sheet.append(customer)
# 엑셀 파일 저장
workbook.save(filename)
# 고객 데이터 생성
num_customers = 100
customers = generate_customer_data(num_customers)
# 엑셀 파일 생성 및 저장
filename = 'customer_data.xlsx'
create_excel_file(filename, customers)
print(f"{filename} 파일이 생성되었습니다.")
