天道酬勤

好好活


  • 首页

  • 归档

  • 分类

  • 标签

  • 关于

  • 搜索

python

发表于 2017-02-24 | 分类于 技术
字数统计 192 | 阅读时长 1

Python


the Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
以快速排序实现为开端
def quicksort(array):
    less = []
    greater =[]
    if len(array) <= 1:
        return array
    pivot = array.pop()
    for x in array:
        if x <= pivot:
            less.append(x)
        else:
            greater.append(x)
    return quicksort(less) + [pivot] + quicksort(greater)

就这样开始吧~

发表于 2017-02-13 | 分类于 生活
字数统计 118 | 阅读时长 1
有一个老板跟员工出去吃饭,路上见一辆最新款的布加迪威龙跑车。员工们纷纷议论,这时老板笑着说:“不要羡慕,要相信自己。我相信,只要大家肯努力,明年我就可以买一辆了。“ 😄


很喜欢的一句话:All work and no play makes Jack a dull boy; all play and no work makes Jack a mere boy!


带着愉悦的心情,开始我的不一样的人生!好好活~

12
lipengfei

lipengfei

Stay Hungry Stay Foolish

7 日志
3 分类
4 标签
GitHub FaceBook
Creative Commons
© 2017 - 2019 lipengfei
0%