- 1

Please help me find out what is wrong in this code.

# I am a beginner and this is a short code that will convert the fluid given to a patient in mls through Soluset to drops per mins. A Soluset delivers 60 drops in one ml. Thank you fluid = input ("What is the name of the fluid you want to give? ") mls = input ("How many mls do you want to give via soluset: \n") hours = input ("How long do you want to give it in hours: \n") mins= input ("How long do you want to give it in minutes: ") drops = float(mls) * 60 hours_min = float(hours) * 60 if hours == True: soluset_hours = drops/hours_min print ("The drops per min via soluset when giving "+ mls + " mls" + " of " + fluid + " is " + str(soluset_hours)) else: if mins==mins: mins=float(mins) soluset_mins = drops/mins print ("The drops per min via soluset when giving "+ mls + " mls" + " of " + fluid + " is " + str(soluset_mins)) If I put the name of the fluid as "saline" mls as 300 hours as 3 and mins as 0 or just enter It creates a traceback. I will appreciate any help

30th Mar 2020, 6:24 PM
chisom
chisom - avatar
10 Answers
0
The traceback keeps saying I can't convert the string mins to float.. That is where the problem is
30th Mar 2020, 6:36 PM
chisom
chisom - avatar
0
Thanks a lot. Let me check again
30th Mar 2020, 7:04 PM
chisom
chisom - avatar
0
Just checked and it is the same thing. It says Value error: line 20 Could not convert mins to float This happens when I press the enter button for input for mins When I write zero instead, it tells me that I can't divide by zero
30th Mar 2020, 7:09 PM
chisom
chisom - avatar
0
@swim can you try not to input anything for mins? Let's say you want to convert 300 mls in 3 hours
30th Mar 2020, 7:20 PM
chisom
chisom - avatar
0
Hmm. Kk
30th Mar 2020, 7:29 PM
chisom
chisom - avatar
0
Chisom check using different variable name except mins
1st Apr 2020, 3:19 PM
Oishik Sinha
Oishik Sinha - avatar