-
-
Save ychaouche/3adb548eba56633163106ae12e266aaa to your computer and use it in GitHub Desktop.
This file contains 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
# open csv file | |
file = open("X.csv") | |
fileReader = csv.reader(file) | |
# sum score | |
for row in fileReader[9:89]: | |
# sum scores for rows 10 to 90 in columns 2 and 3 | |
score1 += int(row[1]) | |
score2 += int(row[2]) | |
# scoring system | |
score1 = round(score1*100/max(score1, score2)) | |
score2 = round(score2*100/max(score1, score2)) | |
# results | |
print("Score1: " + str(score1)) | |
print("Score2: " + str(score2)) | |
if score1 > score2: | |
print("Player 1 wins!") | |
elif score1 < score2: | |
print("Player 2 wins!") | |
else: | |
print("Draw!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment