Skip to content

Basic

import

from collections import deque

iterate

init dictionary

from collections import defaultdict

# init
hashmap = defaultdict(list)

允许内部函数修改外部函数中定义的变量

  • nonlocal