Секція 1. Розділ 16
single
Challenge: Compare Regional Performance
Свайпніть щоб показати меню
Завдання
Проведіть, щоб почати кодувати
Create a function compare_regional_performance() that builds a regional sales DataFrame, computes key metrics, and prints a formatted summary.
- Create a DataFrame with columns
"Region"and"Sales"containing at least four regions and their sales values - Calculate total sales — the sum of the
Salescolumn - Identify the region with the highest sales and its value
- Identify the region with the lowest sales and its value
- Print a summary that includes:
- A header:
Regional Sales Summary: - Total sales as:
Total Sales: {value} - Highest performing region as:
Highest Sales: {region} ({value}) - Lowest performing region as:
Lowest Sales: {region} ({value}) - A label
All Regions:followed by a table of all regions and their sales
- A header:
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 1. Розділ 16
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат