You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
529 B
Python

2 years ago
#!/usr/bin/env python3
INPUT_FILE = 'input'
def main():
content = map(str.strip, open(INPUT_FILE, 'r').readlines())
score = 0
for line in content:
c1 = line[:len(line)//2]
c2 = line[len(line)//2:]
for char in c1:
if char in c2:
print(char)
if char.islower():
score += ord(char) - 96
else:
score += ord(char) - 38
break
print(score)
if __name__ == '__main__':
main()