看啥推荐读物
专栏名称: 编程派
Python程序员都在看的公众号,跟着编程派一起学习Python,看最新国外教程和资源!
今天看啥  ›  专栏  ›  编程派

Python函数里的爱情故事

编程派  · 公众号  · Python  · 2017-05-10 11:38
全文约 3200 字,读完可能需要 4 分钟。一直被拒型def my_love_story():    for girl in every_girl_I_liked:        response = declare_love(girl)        if response != "NO":            raise RunTimeError("There must be something wrong with the                 girl.")孤单型def my_love_story():    return None自己动手型def my_girl_friend():    return "Right Hand"或者import randomdef my_girl_friend():    my_girl_friends = ["Left Hand", "Right Hand"]    return random.choice(my_girl_friends)风流型def my_love_story():    for girl in every_girl_I_have_met:        sleep_with(girl)一见钟情型def my_love_story():    assert love_at_first_sight(my_girl_friend) is True钟爱一生型def my_love_story():    girl = met_a_girl()    girl_friend = dated_her(girl)    wife = got_married(girl_friend) ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照