Jul-30-2019, 03:19 PM
Hello. hope you can help me.
first. here is my code
I want it to jump to step 18 if medicin != fentanyl or midazolam or stesolid.
I am getting frustrated. I hope there is a simple solution to this.
first. here is my code
medicin = input("hvilken medicin skal du give? ").lower() #What medicine are you giving? if medicin == "fentanyl": #If the medicine is fentanyl, then ask vægt = int(input("Hvad vejer patienten? ")) # what is your weight dosis = float(input("Hvilken dosis pr kg vil du give? ")) #what dose per kg do you want to give indgift_mikrogram = dosis * vægt #dose in micrograms indgift_ml = dosis * vægt * 2 / 100 # dose in ml print(f"<Du skal give {indgift_mikrogram} mikrogram") print(f"Du skal give {indgift_ml} ml fentanyl") elif medicin == "midazolam" or "stesolid": #If medicin != fentanyl, but == midazolam or == stesolid vægt = int(input("Hvad vejer patienten? ")) # weight? if vægt < 50: dosis_steso = vægt / 5 indgift_steso = vægt / 5 * 2 / 10 print(f"Du skal give {dosis_steso} mg") print(f"Du skal give {indgift_steso} ml ") else: print("Du skal give 10 mg - 2 ml") else: print("ikke forstået") # if medicin != fentanyl or midazolam or stesolidthe problem is that if I type anything else than "fentanyl" it jumps to step 10.
I want it to jump to step 18 if medicin != fentanyl or midazolam or stesolid.
I am getting frustrated. I hope there is a simple solution to this.