Created
March 17, 2014 15:17
-
-
Save takuma7/9601156 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf8 | |
import a2 | |
import csv | |
reader = csv.DictReader(open("evaluation-values.csv")) | |
leapAvg = 0 | |
leapNum = 0 | |
nonLeapAvg = 0 | |
nonLeapNum = 0 | |
for row in reader: | |
if(a2.isLeapYear(int(row["誕生年"]))): | |
leapAvg += int(row["評価点 (100点満点)"]) | |
leapNum += 1.0 | |
else: | |
nonLeapAvg += int(row["評価点 (100点満点)"]) | |
nonLeapNum += 1.0 | |
leapAvg /= leapNum | |
nonLeapAvg /= nonLeapNum | |
print "閏年生まれの人の平均評価点:\t{0}\n閏年生まれでない人の平均評価点:\t{1}".format(leapAvg, nonLeapAvg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment