#!/usr/bin/env python3 q = [1,2,3,4,5,6] q = [0] + q # добавить в началоprint(q) q.pop(0) # удалить из началаprint(q) q.append(7) # добавить в конецprint(q) q.pop() # удалить с концаprint(q)
Standard input is empty
[0, 1, 2, 3, 4, 5, 6] [1, 2, 3, 4, 5, 6] [1, 2, 3, 4, 5, 6, 7] [1, 2, 3, 4, 5, 6]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!