Computer Science, asked by DhakshinAV13, 5 months ago

Write a program to shift elements of a list so the first elements moves to the second index and so on and last to first like [10,20,30,40] to [20,30,40,10]

plz don't spam.. ​

Answers

Answered by da4729204
2

Answer:

list_to_be_shifted= [10,20,30,40]

for i in range(0,len(list_to_be_shifted)):

temp_var = list_to_be_shifted[0]

list_to_be_shifted[0] = list_to_be_shifted[1]

list_to_be_shifted[1] = temp

Similar questions