Skip to content

Commit

Permalink
Use correct numbers for sales.py and add a quick histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
gahjelle committed Sep 28, 2023
1 parent 0ddb3fe commit b588e81
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions python-312/sales.py
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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]}"
)

0 comments on commit b588e81

Please sign in to comment.