首页 > 解决方案 > python中set()中的花括号和方括号

问题描述

我不明白为什么 current.value 在这里被方括号包围:

    current = linkedlist.head
    seen = set([current.value])

我的第一反应是写 ''' seen = set(current.value) '''

而且我不明白为什么这不起作用。

谢谢

标签: pythonsetbrackets

解决方案


推荐阅读