scores = [0]*102 #for each line in the file increment count of that score for line in open("scores.txt"): scores[int(line)]+=1 for i in range(len(scores)): if scores[i] > 0: print(str(i) + ": " + "*" * scores[i])