Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I make a condition where a variable needs to have a range of numbers (lets say from 1 to 10) to be True?

Hipertensión1 = S == range(140,159) and D == range(90,99)
So I’m trying to make a project related to the medical field.

I want the systolic value to be between 140 and 159 and the Diastolic value between 90 and 99 for Hipertension type 1 to be True.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

if (140 <= systolic_value <= 159) and (90 <= diastolic_value <= 99):
    hypertension_1 = True
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading