Q. Consider the following code:


x = int (input ("Enter the value of 'x' :- "))
if x > 3:
    if x <= 5:
        y = 1
    elif x != 6:
        y = 2
    else:
        y = 3
else:
    y = 4

If y has the value 2 after executing the above program fragment, then what do you know about the initial value of x?


Answer :-

Value of x should be greater then 5 but less than 6

4 Comments

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

  1. Replies
    1. No!!!The value of x should not be greater than 5 and less than 6; instead, it should be greater than 6.

      नहीं!!! x का मान 5 से अधिक और 6 से कम नहीं होना चाहिए; इसके बजाय, यह 6 से अधिक होना चाहिए।

      Delete
  2. But really, good work.

    ReplyDelete

Post a Comment

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

Previous Post Next Post