Discuss / Python / 调试一下以下代码大概懂了是怎么个流程

调试一下以下代码大概懂了是怎么个流程

Topic source

# -*- coding:utf-8 -*-

from collections import Counter

c = Counter()

for ch in "programmer":

    print(c[ch])

    c[ch] = c[ch]+1

    print(c[ch])

print(c)

Sagehours

#2 Created at ... [Delete] [Delete and Lock User]

 确实没大懂这里的逻辑c[ch] = c[ch]+1


  • 1

Reply