Question: We analyze customer data to segment them based on their spending habits over four quarters of the year. Customers are categorized as High - Spenders,

We analyze customer data to segment them based on their spending habits over four quarters of the year. Customers are categorized as High-Spenders, Medium-Spenders, or Low-Spenders based on their total yearly spending
High-Spenders: Total yearly spending >2000
Medium-Spenders: Total yearly spending between 1000 and 2000
Low-Spenders: Total yearly spending <1000
Given a list of customers' spending in each quarter, write a program that:
Calculates the total yearly spending for each customer. Assigns each customer to the correct segment based on their total yearly spending. Prints the customer name and their corresponding segment.
Customer data is defined in list of dictionaries.
customers =[
{'name': 'Alice', 'Q1': 500,'Q2': 600,'Q3': 400,'Q4': 700},
{'name': 'Bob', 'Q1': 200,'Q2': 300,'Q3': 250,'Q4': 150},
{'name': 'Charlie', 'Q1': 800,'Q2': 700,'Q3': 900,'Q4': 850}
]
Write a python program for this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!