Python3 code to demonstrate Shift from Front to Rear in List using insert() + pop()


Topic: Python3 code to demonstrate Shift from Front to Rear in List using insert() + pop()

Solution

test_list = [1, 4, 5, 6, 7, 8, 9, 12] 
print ("The original list is : " + str(test_list)) 
test_list.insert(len(test_list) - 1, test_list.pop(0)) 
print ("The list after shift is : " + str(test_list)) 



List all Python Programs