Answered step by step
Verified Expert Solution
Question
1 Approved Answer
My question is how can I search our database for all the customers who have spent over $1,000 while printing a list of all our
My question is how can I search our database for all the customers who have spent over $1,000 while printing a list of all our customers in the US and Canada to offer them free shipping on all purchases over $30?
here is csv https://drive.google.com/file/d/1h6qI60Q9fpoqHf2qcJ4h3iK2bprZUoSt/view?usp=sharing
I apologize I messed up my last question.
here is my code
import csv import re data = [] with open('customerData.csv') as csvfile: reader = csv.DictReader(csvfile) for row in reader: data.append(row) names_spent_over_1000_past_12_months = [] for i in range(len(data)): if (float(data[i]['Spent Past 12 Months'][1:]) > 1000) and ( data[i]['Credit Card'] == 'Diners Club United States & Canada'): names_spent_over_1000_past_12_months.append(data[i]['Name']) print(names_spent_over_1000_past_12_months)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started