From b588e811db24210484e9c4194e1a730678c2ca6f Mon Sep 17 00:00:00 2001 From: gahjelle Date: Thu, 28 Sep 2023 13:17:58 +0200 Subject: [PATCH] Use correct numbers for sales.py and add a quick histogram --- python-312/sales.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/python-312/sales.py b/python-312/sales.py index 14500777b5..3ec3e03b1b 100644 --- a/python-312/sales.py +++ b/python-312/sales.py @@ -1,11 +1,11 @@ import calendar sales = { - calendar.JANUARY: 10, - calendar.FEBRUARY: 12, - calendar.MARCH: 8, + calendar.JANUARY: 5, + calendar.FEBRUARY: 9, + calendar.MARCH: 6, calendar.APRIL: 14, - calendar.MAY: 16, + calendar.MAY: 9, calendar.JUNE: 14, calendar.JULY: 21, calendar.AUGUST: 22, @@ -14,4 +14,7 @@ } for month in calendar.Month: if month in sales: - print(f"{month.value:2d} {month.name:<10} {sales[month]:2d}") + print( + f"{month.value:2d} {month.name:<10}" + f" {sales[month]:2d} {'*' * sales[month]}" + )