![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
v5_MRsu_v5
技术宅!
展开
-
python3学习之路(1)
最后我们看一个好玩的函数,从一个集合中查找最大或者最小的N个元素!import heapq >>> nums =[1,2,332,4,45,63,4,34,5,556] >>> print(heapq.nlargest(3,nums)) >>> print(heapq.nsmallest(3,nums)) >>> top_web=[{'name':'IBM','shares':100,'price':91.1}, {'name':'FB','shares':50,'price':543} , {'name'原创 2016-07-01 10:38:40 · 298 阅读 · 0 评论 -
python3学习之路(2)简单的代码结构
昨天聊了聊python容器,今天我们来聊聊代码结构吧 ##这仅仅是个送给闰年出生的人们的! months=['January','February','March','April','May','June','July','August','September','October','November','December'] fruits =['Banana','Apple','Water原创 2016-07-02 10:04:24 · 235 阅读 · 0 评论