01
This commit is contained in:
22
01/01-02.py
Normal file
22
01/01-02.py
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
input_file = open("input.txt", "r")
|
||||
|
||||
left = []
|
||||
right = []
|
||||
|
||||
for line in input_file:
|
||||
a, b = line.split()
|
||||
left.append(int(a))
|
||||
right.append(int(b))
|
||||
input_file.close()
|
||||
|
||||
print(left)
|
||||
print(right)
|
||||
|
||||
list_similarity = 0
|
||||
for i in range(len(left)):
|
||||
list_similarity += right.count(left[i]) * left[i]
|
||||
|
||||
print(f'List-Similarity: {list_similarity}')
|
||||
Reference in New Issue
Block a user