1. Build a report path
Write code Easy ✓ CompletedWrite report_path(base, year, month) that returns a Path (not a string) in this shape: <base>/reports/<year>/sales_<month>.csv, where the month always has two digits. For example report_path("exports", 2025, 3) is exports/reports/2025/sales_03.csv. Join the pieces with /. The program prints the path for the starter call.
from pathlib import Path
def report_path(base, year, month):
# build exports/reports/2025/sales_03.csv as a Path
pass
print(report_path("exports", 2025, 3))
from pathlib import Path
def report_path(base, year, month):
return Path(base) / "reports" / str(year) / f"sales_{month:02d}.csv"
print(report_path("exports", 2025, 3))