pythonでdequeの中身を出力するには*dq
とすればOK
test.py
from collections import deque
L = deque()
L.append("a")
L.append("b")
L.append("c")
# deque 1つの場合
print(*(L))
L2 = deque()
L2.append("d")
L2.append("e")
L2.append("f")
# deque 2つ足す場合
print(*(L + L2))
# 上記だと、なぜか空白が一緒にprint()されるので、、、文字列にして空白を削除する
str = "".join(list(L + L2))
print(str)
実行
$ python test.py
a b c
a b c d e f
abcdef