Standardize output

This commit is contained in:
Joscha 2018-12-02 22:38:33 +00:00
parent f2f6c048fb
commit 754bf75bd3

View file

@ -10,6 +10,8 @@ def load_freqs(filename):
freqs.append(n) freqs.append(n)
return freqs return freqs
# PART 2
def find_repeat(freqs): def find_repeat(freqs):
total = 0 total = 0
found = {total} found = {total}
@ -24,11 +26,9 @@ def find_repeat(freqs):
def main(filename): def main(filename):
freqs = load_freqs(filename) freqs = load_freqs(filename)
print(" Part 1") print(f"Solutions for {filename}")
print(f"Total: {sum(freqs)}") print(f"Part 1: {sum(freqs)}")
print() print(f"Part 2: {find_repeat(freqs)}")
print(" Part 2")
print(f"First repeat: {find_repeat(freqs)}")
if __name__ == "__main__": if __name__ == "__main__":
for filename in sys.argv[1:]: for filename in sys.argv[1:]: