mirror of
https://github.com/Crocmagnon/advent-of-code.git
synced 2024-07-05 06:21:16 +02:00
18 lines
415 B
Python
18 lines
415 B
Python
|
def main():
|
||
|
lines = []
|
||
|
with open("inputs/day01") as f:
|
||
|
for line in f:
|
||
|
lines.append(int(line.strip()))
|
||
|
|
||
|
stop = len(lines)
|
||
|
for i, value in enumerate(lines):
|
||
|
for j in range(i+1, stop):
|
||
|
other = lines[j]
|
||
|
addition = other + value
|
||
|
if addition == 2020:
|
||
|
print("result is", other * value)
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
main()
|