Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

2. Which country has the absolute advantage in wheat production?

Answered: 1 week ago