Need a clarification on if condition with and operator

Question:

Please correct me if i am wrong:

a = "Disabled"

if a == "Disabled" and "Disable":
    print('True')
else:
    print('False')

if a is "Disabled" or "Disable"
Asked By: Hoster

||

Answers:

What you wanted to write is

if a == "Disabled" or a == "Disable":

Other option is

if a in ("Disabled", "Disable):
Answered By: brevno
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.