Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This is the code im using to gather information from
- year = 2023
- appointment_month = int(input('Select Month: '))
- appointment_day = int(input('Select Day: '))
- d = dt(year, appointment_month, appointment_day)
- month, day = d.month, d.day
- print(f"Appointment will be set for {day}/{month}/{year}")
- for doctor in doctors:
- doctor.add_appointments(d)
- break
- #This is how I'm converting that information into a report
- for doctor in doctors:
- appointments = doctor.get_appointments()
- if appointments:
- print("Please enter month with single or double digit\n example: '1' or '01'")
- month = int(input("choose a month: "))
- else:
- print("Please add appointments first.")
- for appointment in appointments:
- if appointment.month == month:
- print(appointment.strftime("%d/%b/%Y"))
- break
- #and this is my attempt so far on matplotlib to turning it into a bar chart, but ive not got an output yet
- names = []
- values = []
- for doctor in doctors:
- month = []
- appointments = doctor.get_appointments()
- for appointment in appointments:
- if appointment.month == month:
- names.append(month)
- values.append(appointment)
- plt.bar(names, values, color=(0.1, 0.1, 0.1, 0.1), edgecolor='black')
- plt.show()
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement