0
Not working. Help!
systolic = input("Enter systolic value: ") diastolic = input("Enter diastolic value: ") if systolic = (230): print("Invalid number") break elif diastolic = (50): print("Invalid number: ") else: print("Systolic: " + systolic) print("Diastolic: " + diastolic)
5 RĂ©ponses
+ 2
It can be done more easily. -->
systolic = int(input("Enter systolic pressure: "))
diastolic = int(input("Enter diastolic pressure: "))
if systolic >= 230 or diastolic <= 50:
print("Hello, mr. ghost!")
else:
print("systolic :", systolic)
print("diastolic :", diastolic)
Note :
you cannot compare str type (e.g. systolic) to int type (230).
== is the comparison operator not =
+ 2
đđąđąđđš đđĄđđČđđ„
But systolic and diastolic are strings and (230) and (50) are integers probably, not?
+ 2
đđąđąđđš đđĄđđČđđ„
That's right now.