Advertisement
Guest User

Untitled

a guest
Jan 10th, 2023
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. #This is the code im using to gather information from
  2.  
  3. year = 2023
  4. appointment_month = int(input('Select Month: '))
  5. appointment_day = int(input('Select Day: '))
  6. d = dt(year, appointment_month, appointment_day)
  7. month, day = d.month, d.day
  8. print(f"Appointment will be set for {day}/{month}/{year}")
  9. for doctor in doctors:
  10. doctor.add_appointments(d)
  11. break
  12.  
  13. #This is how I'm converting that information into a report
  14.  
  15. for doctor in doctors:
  16. appointments = doctor.get_appointments()
  17. if appointments:
  18. print("Please enter month with single or double digit\n example: '1' or '01'")
  19. month = int(input("choose a month: "))
  20. else:
  21. print("Please add appointments first.")
  22. for appointment in appointments:
  23. if appointment.month == month:
  24. print(appointment.strftime("%d/%b/%Y"))
  25. break
  26.  
  27. #and this is my attempt so far on matplotlib to turning it into a bar chart, but ive not got an output yet
  28. names = []
  29. values = []
  30. for doctor in doctors:
  31. month = []
  32. appointments = doctor.get_appointments()
  33. for appointment in appointments:
  34. if appointment.month == month:
  35. names.append(month)
  36. values.append(appointment)
  37. plt.bar(names, values, color=(0.1, 0.1, 0.1, 0.1), edgecolor='black')
  38. plt.show()
  39. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement