dict.get(key, default=None)
key -- This is the Key to be searched in the dictionary.
default -- This is the Value to be returned in case key does not exist.
window_counts = {}
window_counts[char] = window_counts.get(char, 0) + 1
## 如果字典window_counts中没有key==char的项,
## 则get()函数返回0,此时将在字典window_counts创建一个新的项。