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

Having A Problem With If Statements In Python

My goal is to have something like this:

x = 201
if x >= 100 <= 200: 
    print(x)
else:
    print('Less Than 100 Or More Than 200')

but it doesn’t work:

output: 201

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

basically anything smaller than or equal 100 and anything smaller or equal 200

Would this be possible?

>Solution :

you wanna do this :

x = 201
if  100<= x <= 200: 
    print(x)
else:
    print('Less Than 100 Or More Than 200')
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