kuroko/test/testDeque.krk

21 lines
279 B
Python
Raw Permalink Normal View History

2021-01-11 08:08:05 +03:00
from collections import deque
let d = deque('ghi')
d.append('j')
d.appendleft('f')
print(d)
print(d.pop())
print(d.popleft())
print([i for i in d])
print(d[0])
print(d[-1])
print('h' in d)
d.extend('jkl')
print(d)
d.rotate(1)
print(d)
d.rotate(-1)
print(d)
d.reverse()
print(d)