Q. Write a Program to shift elements of a list so that the first element moves to the second index and second index moves to the third index, and so on, and the last element shifts to the first position.
Suppose the list is [10, 20, 30, 40]
After shifting, it should look like: [40, 10, 20, 30]
Answer =
lst = eval(input("enter the list = ")) print ("New list =", [lst[ -1] ] + lst[0 : -1] )
very well work
ReplyDeleteThank you : )
DeleteThank you 😊😊
ReplyDeleteThanks 😌😌☺️ for helping me
ReplyDeleteWelcome : )
DeleteNice thank you
ReplyDeleteWelcome : )
Deletegreat
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )