Dosuu Bunpu ----------------------------------------------------- # ten<=0, 0 han_i[waku]: if ten <= han_i[waku+1]: break bunpu[waku]+=1 print(bunpu) # Dosuu Bunpu-zu by print( ) for a in range(11): for b in range(bunpu[a]): print("*",end="") print() ---------------------------------------------------------- # 0<=ten<10, 10<=ten<20, ... , 100<=ten infile=open('/content/drive/MyDrive/data/Kokugo.txt') tokuten_hyou = infile.readlines() infile.close() tokuten=[int(moji) for moji in tokuten_hyou] han_i=[0,10,20,30,40,50,60,70,80,90,100,110] bunpu=[0,0,0,0,0,0,0,0,0,0,0] for ten in tokuten: for waku in range(11): if ten >= han_i[waku]: if ten < han_i[waku+1]: break bunpu[waku]+=1 print(bunpu) # Dosuu Bunpu-zu by print( ) for a in range(11): for b in range(bunpu[a]): print("*",end="") print() ---------------------------------------------------------- # Dougu-bako (module, package, library) import matplotlib infile=open('/content/drive/MyDrive/data/Kokugo.txt') tokuten_hyou = infile.readlines() infile.close() tokuten=[int(moji) for moji in tokuten_hyou] matplotlib.pyplot.hist(tokuten, bins=11)