#!/usr/bin/python3 # Hmm yes, pythonian # This makes me want to say bad things filename = "input" with open(filename, "r") as f: lines = f.read() lines = lines.split() for numa in lines: numa = int(numa) for numb in lines: numb = int(numb) if numa + numb != 2020: continue product = numa * numb print(numa, numb, product) break else: continue break