有什么区别:
things = []
things = {}
things = set()
我尝试使用谷歌搜索,但很难在不知道其实际名称的情况下通过谷歌搜索此类仅带有括号的结构来识别它们。
还有 (element1, element2) 我见过作为参数传递给函数的,但我不知道 Python 将其解释为什么。
最佳答案
这些是
欢迎使用 Python!
哦,我忘了说,如果你也是 Python 新手(甚至不是),我建议你查看 IPython .
当你对 python 什么都不懂的时候,就去做:
help(thing)
例如
help([]) # will show this ...
Help on list object:
class list(object)
| list() -> new empty list
| list(iterable) -> new list initialized from iterable's items
|
关于python - 这些 Python 结构之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21424241/