fork download
  1. #!/usr/bin/env python3
  2.  
  3. q = [1,2,3,4,5,6]
  4.  
  5. q = [0] + q # добавить в начало
  6. print(q)
  7.  
  8. q.pop(0) # удалить из начала
  9. print(q)
  10.  
  11. q.append(7) # добавить в конец
  12. print(q)
  13.  
  14. q.pop() # удалить с конца
  15. print(q)
Success #stdin #stdout 0.02s 27704KB
stdin
Standard input is empty
stdout
[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]