Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calculate_dose(massa, aika, kok_annos):
- i = int(input(massa))
- j = int(input(aika))
- k = int(input(kok_annos))
- if k > 4000 or j < 6:
- return 0
- elif k + i * 15 <= 4000:
- return i * 15
- elif k + i * 15 > 4000:
- x = int(4000 - k)
- return x
- def main():
- 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): ")
- print("The amount of Parasetamol to give to the patient: ",)
- print(calculate_dose(aika,massa, kok_annos))
- # calculate_dose assumes parameters to be of type int
- # and they should be passed in the order: weight, time, total_doze_24
- # (or more like the automated tests assume this)
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement