Q. What is the output of the following code?
for i in range (4) :
for j in range (5) :
if i + 1 == j or j + i == 4 :
print ("+", end = ' ')
else :
print ("o", end = ' ')
print ()
Answer =
Output: -
o + o o + o o + + o o o + + o o + o o +
Could you please explain why is the output as so?
ReplyDeleteAt first you have to understand how "for" loop is working then think the program then you will able to write Output.
DeletePlease give complete Explanation
DeleteOk.
DeleteOutput is wrong
ReplyDeleteYou are wrong , please copy the above code and see output
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )