76 836
Assignments Done
Successfully Done
In June 2019

Answer to Question #39170 in Python for Afreen

Question #39170
Write a python program that rotates the elements of a list so that the element at the first index moves to the second index,the element in the second index moves to the third index,etc,and the element in the last index moves to the first index.
Expert's answer
a = [1,2,3,4,5,6,7,8,9,0]

def cycle_move(l):
l_new = [l[-1]]
for i in l[:-1]:
return l_new

print cycle_move(a)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions