Menu

[Solved]-Q1 Good Customers Really Big Lots Customer Analysis Follows List Customers Synchronized As Q37281075

Q1) Good Customers
Really Big Lots is doing a customer analysis as follows:
Here is a list of customers and a synchronized/associated list ofspending for last years quarters.
customersA = [“Kim”, “Sophia”, “Lee”, “Ahmed”]
spendingA = [602.23, 480.8, 300.23, 528.08]   
target = 500

Write the function that will take as parameters, anylist of customers, a list of their spending, and a target amount,and do the following: (Remember , these are parameters, that arejust place holders that will be replaced with arguments when thefunction is called.
Part I
Your function should produce the following, when run

a If a customer spends more than the target amount,
print out their name and amount, identify them as “BigSpenders”
b. return the total spending of all customers
Part II
d. Call your function with the arguments customersA and spendingAlists above and the target of 500
e. Capture the output of your function, that is, there are internalprints as the function runs.
e. Print out the resultant total of all customers, properlyidentified,

def BigSpenders( customer, spending, target):
totalSpending = 0
for index in range(len(customer)):
totalSpending = totalSpending + spending[index]
if spending[index] > target:
print(“Big Spender “, customer[index], “Amount “,spending[index])
return totalSpending
#note I can explicitly enter lists, rather than give themnames
result =BigSpenders( [“Amy “, “Sam “, “Cal”, “Foo”], [501, 456,230, 609],500)
print(“Spending Total “, result)

I need the python code here there are seversteps to the probelm as listed above.

Expert Answer


Answer to Q1) Good Customers Really Big Lots is doing a customer analysis as follows: Here is a list of customers and a synchroniz… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *