41 lines
754 B
Python
41 lines
754 B
Python
import sys
|
|
arr = []
|
|
|
|
with open(sys.argv[1]) as f:
|
|
for l in f:
|
|
arr.append(l.split())
|
|
|
|
score = 0
|
|
total_score = 0
|
|
|
|
for x in arr:
|
|
#print(x)
|
|
if x[0] == 'A':
|
|
if x[1] == 'X':
|
|
score = (3+0)
|
|
elif x[1] == 'Y':
|
|
score = (1+3)
|
|
elif x[1] == 'Z':
|
|
score = (2+6)
|
|
|
|
if x[0] == 'B':
|
|
if x[1] == 'X':
|
|
score = (1+0)
|
|
elif x[1] == 'Y':
|
|
score = (2+3)
|
|
elif x[1] == 'Z':
|
|
score = (3+6)
|
|
|
|
if x[0] == 'C':
|
|
if x[1] == 'X':
|
|
score = (2+0)
|
|
elif x[1] == 'Y':
|
|
score = (3+3)
|
|
elif x[1] == 'Z':
|
|
score = (1+6)
|
|
#print (score)
|
|
total_score += score
|
|
score = 0
|
|
|
|
print(total_score)
|