From a5e3f33b16e30173149282263f4d490d81f7db94 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Fri, 4 Dec 2020 14:18:52 +0100 Subject: [PATCH] Golf day 4 parser a little --- d04.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d04.py b/d04.py index 5184ad1..17058fc 100755 --- a/d04.py +++ b/d04.py @@ -2,7 +2,7 @@ from sys import argv -p = [{e.split(":")[0]: e.split(":")[1] for e in l.replace("\n", " ").split()} for l in open(argv[1]).read().split("\n\n")] +p = [dict(e.split(":") for e in l.split()) for l in open(argv[1]).read().split("\n\n")] fi = ["byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"]