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.
ok a
ReplyDelete???
Deleteok
ReplyDeleteaverage
You are wrong output will 'ok' only.
DeleteHe is correct as both
ReplyDeleteok
average
will come as it both satisfies the code
You are wrong. Please run the code in your pc.
DeleteIf u are sure then I am confident
ReplyDeletePlease share screen shot on telegram.
Deletei tried in my computer it is giving the output as
ReplyDeleteok
average
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )