Q. Predict the output:


Odd = 1, 3, 5

print (Odd + [2, 4, 6])[4])

print (Odd + (12, 14, 16] ) [4] - (Odd + [2, 4, 6] [4])


Answer =

It will give an error.  Because according to the question Odd is a tuple, not List. So,

The correct code is :-

Odd = [1, 3, 5]
print ((Odd + [2, 4, 6])[4])
print ((Odd + [12, 14, 16 ])[4] - (Odd + [2, 4, 6])[4] )

Output :-

4
10
>>> 


12 Comments

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

  1. The question is different as per my book.
    It is :
    odd=[1,3,5]
    print((odd+[2,4,6])[4])
    print((odd+[12,14,16])[4]-(odd+[2,4,6])[4])

    ReplyDelete
  2. Thank you for Answer the other question

    ReplyDelete
  3. thank u so muchh very helpful god bless frfr

    ReplyDelete
  4. Don't give only the output ,please give the full answer for better understanding.

    ReplyDelete
    Replies
    1. Please give the answers step by step.

      Delete
    2. I have given. Please check it again.

      Delete
  5. You're currently saving me in 11th and you will save me in 12th too. Thank you.

    ReplyDelete
  6. Is there any video

    ReplyDelete

Post a Comment

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

Previous Post Next Post