相关疑难解决方法(0)

使用set()或{}创建集合的差异

这种差异使我感到困惑:

>>> s = "()())()"
>>> print set(s)

set([')', '('])

>>> print {s}

set(['()())()'])
Run Code Online (Sandbox Code Playgroud)

为什么?

python

6
推荐指数
3
解决办法
243
查看次数

标签 统计

python ×1