Q. Write the output of the following program on execution if x = 50:


if x > 10 :

    if x > 25 :

        print("ok")

    if x > 60 :

        print("good")

elif x > 40 :

    print("average")

else:

    print("no output")


Output:-

ok
>>>


Because if  'if' statement becomes true then 'elif' and 'else' statements will not execute. 

9 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. He is correct as both
    ok
    average
    will come as it both satisfies the code

    ReplyDelete
    Replies
    1. You are wrong. Please run the code in your pc.

      Delete
  2. If u are sure then I am confident

    ReplyDelete
  3. i tried in my computer it is giving the output as
    ok
    average

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post