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
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
Social Sciences,
3 months ago
Economy,
3 months ago
Economy,
8 months ago
Art,
11 months ago
Political Science,
11 months ago
Physics,
11 months ago