Python基础知识
0 人感兴趣 · 7 次引用
- 最新
- 推荐
Python 已有列表和字典, 为什么还需要元组?
学习了列表和字典之后,再学习元组感觉它没有使用的必要.而且列表和字典已经够用,为什么有了列表还需要元组呢?这个Python特有的数据类型有何作用呢?


关于如何判断一个 list 是否为空的思考
今天随手翻 stackoverflow,看到问题叫 How do I check if a list is empty? 一看这个问题,不难猜到到这是一个刚学 Python 的人提问的,因为这个问题实在是太基础了,那么如何判断呢?

list vs tupple
列表(list)和 元组(tupple) 是 Python 中常见的两种数据结构.这两者使用方法有一定的相似,俩者都是 Python 内置类型,都可以保存数据集合,都可以保存复合数据,我们同样可以通过索引去访问它们.



【Python】 any() 和 or 区别你真的知道吗?
在我之前的文章中有any()和all()的对比: any()和all()对比 其中介绍了any()函数的基本特性---可迭代对象中有任意一个不为False的时候,返回True,如果可迭代对象为空的话,返回False