+ 1

can someone enlighten me with this practice!!! Thank you. Medical Software

This is my code on Medical Software practice in Introduction to Python. This is my attempt, i got test case 2,3 correct and 1 was fail. # Glucose level is an input for this software glucose_level = int(input()) if glucose_level <=70: # Display message if glucose level is less than 70 print("Low glucose level") # Display message if glucose level is greater than 140 if glucose_level > 140: print("High glucose level") # Display message if none of the conditions above are met else: print("Normal range")

29th Aug 2023, 12:50 PM
Minh Duc Vu
6 odpowiedzi
+ 5
what will be the output if the input is 60? then the first condition is true and the last on and so you get two outputs. see the attachment, but this is wrong. you need only one output. do you learnd already someting about the elif statement? https://code.sololearn.com/cDGisZ7vnCC8/?ref=app
29th Aug 2023, 1:25 PM
Angela
Angela - avatar
+ 2
num = 60 glucose_level = int (input()) if glucose_level <= 70: print ("Low glucose_level") elife glucose_level > 140: print ("High glucose_level") else: print ("Normal range") this working
30th Sep 2023, 6:12 PM
AMIR H R 👑💎🕹📱📡 💪
AMIR  H  R 👑💎🕹📱📡 💪 - avatar
+ 2
this code is also good, my opinion is equal and less is better
27th May 2024, 11:26 AM
AMIR H R 👑💎🕹📱📡 💪
AMIR  H  R 👑💎🕹📱📡 💪 - avatar
+ 1
thank you so much, i solved that practice, i should ve focused more on elif
30th Aug 2023, 3:17 AM
Minh Duc Vu
0
this is the solution # Glucose level is an input for this software glucose_level = int(input()) # Display message if glucose level is less than 70 if glucose_level <70: print("Low glucose level") # Display message if glucose level is greater than 140 elif glucose_level > 140: print("High glucose level") # Display message if none of the conditions above are met else : print("Normal range") this code will work they mention less than 70. You write less than or equal 70
27th May 2024, 7:18 AM
ZNM Begum
ZNM Begum - avatar
0
# Glucose level is an input for this software glucose_level = int(input()) # Display message if glucose level is less than 70 if glucose_level <= 60: print("Low glucose level") # Display message if glucose level is greater than 140 elif glucose_level >=150: print("High glucose level") # Display message if none of the conditions above are met else: print("Normal range")
27th Oct 2024, 8:12 PM
Fatih Urgen