import glob

classList = [0] * 10

for f in glob.glob("./img/*.txt"):
    # 行ごとにすべて読み込んでリストデータにする
    data = open(f, "r")
    lines = data.readlines()
    # 一行ずつ表示する
    for line in lines:
        classList[int(line[0])] = classList[int(line[0])] + 1
print(classList)

9ded7009ee84d8f40e4c11b9a9a56e8ac439a1e6
<mask token>

<mask token>
for f in glob.glob('./img/*.txt'):
    data = open(f, 'r')
    lines = data.readlines()
    for line in lines:
        classList[int(line[0])] = classList[int(line[0])] + 1
print(classList)

<mask token>
classList = [0] * 10
for f in glob.glob('./img/*.txt'):
    data = open(f, 'r')
    lines = data.readlines()
    for line in lines:
        classList[int(line[0])] = classList[int(line[0])] + 1
print(classList)

import glob
classList = [0] * 10
for f in glob.glob('./img/*.txt'):
    data = open(f, 'r')
    lines = data.readlines()
    for line in lines:
        classList[int(line[0])] = classList[int(line[0])] + 1
print(classList)

import glob

classList = [0] * 10

for f in glob.glob("./img/*.txt"):
    # 行ごとにすべて読み込んでリストデータにする
    data = open(f, "r")
    lines = data.readlines()
    # 一行ずつ表示する
    for line in lines:
        classList[int(line[0])] = classList[int(line[0])] + 1
print(classList)
