01 2020 档案
摘要:The "First-Class object" in Python: Created at runtime Assigned to a variable or element in a data structure Pass as an augument to a function Return
阅读全文
摘要:1. Handling missing keys with setdefault import sys import re WORD_RE = re.compile('\w+') index = {} print(sys.argv) # Example 3-2 with open(sys.argv[
阅读全文
摘要:1. Managing Ordered Sequences with bisect The bisect module offers two main functions bisect and insort that use the binary serach algorithm to quickl
阅读全文
摘要:1. Listcomps (List comprehensions) do everything the map and filter functions do. (map 函数和 filter函数能做的,列表生成式都可以做) 列表生成式和 map, filter 函数运行时间的比较示例: impo
阅读全文