Q. Predict the output of the following code snippet?


a = [1, 2, 3, 4, 5]

print(a[3:0:-1])



Answer =

[4, 3, 2]
>>>

4 Comments

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

  1. Replies
    1. You are wrong. Please run the program.

      Delete
    2. No ,Its because zeroth index will be excluded..

      Delete
  2. Can u explain how the output is like this I mean the background mechanism details

    ReplyDelete

Post a Comment

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

Previous Post Next Post