================================================================================
  Question 35: Monthly Product Sales Analysis and Visualization
================================================================================

FULL QUESTION:
Task:
1. Create a DataFrame to store monthly sales of three products (Product A,
   Product B, Product C) across 6 months.
2. Calculate the total monthly sales across all three products.
3. Identify and print the month with the highest total sales.
4. Plot a grouped bar chart comparing the monthly sales of all three products.

SHORT QUESTION:
Monthly product sales analysis calculating monthly totals, identifying peak revenue months, and generating bar charts.

================================================================================
README & SETUP INSTRUCTIONS:
================================================================================
# Question 35: Monthly Product Sales Analysis and Visualization

- Prerequisites: Python 3.x, Pandas, Matplotlib (pip install pandas matplotlib).
- Setup: None.
- How to Run: python question_35.py
- Expected Behavior: Computes sales metrics and displays a grouped bar chart showing sales comparison across products.

================================================================================
SOURCE CODE FILES:
================================================================================

1. question_35.py
--------------------------------------------------------------------------------
import pandas as pd
import matplotlib.pyplot as plt

data = {
    "Month": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
    "Product A": [15000, 18000, 12000, 22000, 20000, 25000],
    "Product B": [12000, 15000, 17000, 19000, 24000, 21000],
    "Product C": [9000, 11000, 14000, 13000, 18000, 22000]
}

df = pd.DataFrame(data)

df["Total Sales"] = df[["Product A", "Product B", "Product C"]].sum(axis=1)

print("Monthly Sales DataFrame:")
print(df)
print("=" * 60)

highest_sales_row = df.loc[df["Total Sales"].idxmax()]

print("Month with Highest Total Sales:")
print(f"Month       : {highest_sales_row['Month']}")
print(f"Total Sales : {highest_sales_row['Total Sales']}")
print("=" * 60)

ax = df.plot(
    x="Month",
    y=["Product A", "Product B", "Product C"],
    kind="bar",
    figsize=(9, 5),
    width=0.75
)

plt.title("Monthly Sales Comparison (Product A, B, C)", fontsize=14, fontweight="bold")
plt.xlabel("Month", fontsize=12)
plt.ylabel("Sales Amount ($)", fontsize=12)
plt.xticks(rotation=0)
plt.grid(axis="y", linestyle="--", alpha=0.7)
plt.legend(title="Products")
plt.tight_layout()
plt.show()
--------------------------------------------------------------------------------
