0
Please can you help me with a If/else problem?
I'm stuck on a practice (medical . . .) Where I'm coding an app that tells patients when their blood pressure is normal range,low or high
3 Réponses
+ 1
Blood_pressure=int(input())
if Blood_pressure<=60:
print(low blood pressure)
if Blood_pressure<=61 and Blood_pressure<=120:
print(normal blood pressure)
else:
print(high blood pressure)
+ 3
Wai Yip Tng ,
some comments according the code sample you provided:
> missing quotes around strings
> conditional expressions like in this code should use if... elif... else...
> wrong logic in second if... an input of 50 results in:
low blood pressure
normal blood pressure
> in general:
it is not seen as very helpful when we are going to post a *ready-made code*, as long as the op has not shown his attempt here.
it is more helpful to give hints and tips, so that the op has a chance to find a solution by himself.
+ 1
Fine.