下の入力値とモジュールを用いて合計点と平均点を出力するプログラムを作成しています。
エラーになってしまうのですがどこが間違っていますでしょうか?
#追記
intとリストを比較しているというエラーがでていますがよくわかりません。よろしくお願いいたします。
入力値
88
95
55
35
90
100
10
出力結果(Thresholdが60の場合)
合計点:373
平均点:93.25
コード import sys import csv global threshold threshold = 60 def get_scores(): reader = csv.reader(sys.stdin) line = list() for s in reader: line.append(s) return line def calc_total(scores): score2 = list() for n in scores: if n >= threshold: score2.append(n) elif n < threshold: continue total = sum(score2) return total def calc_count(scores): score2 = list() for n in scores: if n >= threshold: score2.append(n) elif n < threshold: continue lens = len(score2) return lens score_list = get_scores() total = calc_total(score_list) lens = calc_count(score_list) avg = total / lens print('合計点:{}'.format(total)) print('平均点:{}'.format(avg))
エラーメッセージとそれを読んだ感想を質問に追記してください