Home > Software design >  why double if only work for yes. does not work for no?
why double if only work for yes. does not work for no?

Time:12-31

a = 1
b = 2

if a == 1:
    if b == 2:
        
        print("yes")
else:
    print("no")

CodePudding user response:

If you change a to 3, it will print No. If b is anything else than 2, you will print nothing

CodePudding user response:

I thinks youre syntax wrong try this : (a == 1) ? (TRUE) : (FALSE); (b == 2) ? (TRUE) : (FALSE);

also you created 2 if statement, in same condition line...

  • Related