Files
python-aoc-2020/day01/part1.py
Sebastian Seedorf 7c19b98694 Day 1
2020-12-01 22:14:16 +01:00

19 lines
369 B
Python

items = [int(x.strip()) for x in open("input.txt")]
lows = []
highs = []
for item in items:
if item < 1010:
lows.append(item)
else:
highs.append(item)
print(lows)
print(highs)
for low in lows:
for high in highs:
if low + high == 2020:
print("Found {} and {}: Sum={} Product={}".format(low, high, low+high, low*high))