Computer Science, asked by aka007, 8 months ago

what's the python program using list concept to display an expected output below:
Input : lt_con=[1,2,3,4,5,6]

Output :
[2, 3, 4, 5, 6, 1]
[3, 4, 5, 6, 1, 2]
[4, 5, 6, 1, 2, 3]
[5, 6, 1, 2, 3, 4] ​

Answers

Answered by gaddamdinesh1504
0

Answer:Hope it helps!!

Explanation:

def rotate(a,n):

   outlist=[]

   for i in range(n,len(a)):

       outlist.append(a[i])

   for j in range(n):

       outlist.append(a[j])

   print(outlist)

def main():

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

   for i in range(1,5):

       rotate(a,i)

main()

Similar questions