![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
lvfengchang1220
这个作者很懒,什么都没留下…
展开
-
python中列表排序sort()方法或者内建函数sorted()
python列表排序简单记一下python中List的sort方法(或者sorted内建函数)的用法。关键字:python列表排序 python字典排序 sortedList的元素可以是各种东西,字符串,字典,自己定义的类等。sorted函数用法如下:Python代码 sorted(data, cmp=None, key=None,转载 2013-09-19 08:47:23 · 981 阅读 · 0 评论 -
【整理】Python中的__name__和__main__含义详解
背景在写Python代码和看Python代码时,我们常常可以看到这样的代码:?12345def main(): ...... if __name == "__main__": main();其中的函数名main,也可原创 2014-01-23 22:27:59 · 2103 阅读 · 0 评论