21 lines
279 B
Python
21 lines
279 B
Python
|
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)
|