python deque打印
时间: 2023-10-22 17:28:34 浏览: 130
要打印一个Python deque,你可以使用以下代码示例:
```
from collections import deque
# 创建一个deque
d = deque([1, 2, 3, 4, 5])
# 打印deque
print(d)
```
这将输出deque的内容,例如 `[1, 2, 3, 4, 5]`。注意,deque的输出格式是一个包含在方括号中的序列。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [python中的deque](https://blog.csdn.net/weixin_44835655/article/details/127335718)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [python deque模块简单使用代码实例](https://download.csdn.net/download/weixin_38507121/14910424)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文