Advertisement
Guest User

testitesti_

a guest
Jan 21st, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. def calculate_dose(massa, aika, kok_annos):
  2. i = int(input(massa))
  3. j = int(input(aika))
  4. k = int(input(kok_annos))
  5. if k > 4000 or j < 6:
  6. return 0
  7. elif k + i * 15 <= 4000:
  8. return i * 15
  9. elif k + i * 15 > 4000:
  10. x = int(4000 - k)
  11. return x
  12.  
  13.  
  14. def main():
  15.  
  16. calculate_dose("Patient's weight (kg): ", "How much time has passed from the previous dose (full hours): ", "The total dose for the last 24 hours (mg): ")
  17.  
  18. print("The amount of Parasetamol to give to the patient: ",)
  19. print(calculate_dose(aika,massa, kok_annos))
  20.  
  21. # calculate_dose assumes parameters to be of type int
  22. # and they should be passed in the order: weight, time, total_doze_24
  23. # (or more like the automated tests assume this)
  24.  
  25. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement