list1 = [1,2,3,4,5,6,7,8,9,10]
flag = True
while flag == True:
print('The list looks like %s'%list1)
ans = input('Do you want to rotate the elements in the list (y \ n ) ?')
if ans.lower() == 'n':
flag = False
elif ans.lower() == 'y':
rot = input('Do you want to rotate left or right ( l \ r ) ?')
if rot.lower() == 'r':
val = list1.pop(-1)
list1.insert(0,val)
elif rot.lower() == 'l':
val = list1.pop(0)
list1.append(val)
print('The final list looks like %s'%list1)