-
-
Save JeffersGlass/cf670f595c99db49b8564cc600ce26c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fields = ['byr', 'iyr', 'eyr', 'hgt', 'hcl', 'ecl', 'pid'] | |
with open ('input.txt', 'r') as infile: | |
everyLine = ''.join([line for line in infile]) | |
passports = [p.replace('\n',' ') for p in everyLine.split('\n\n')] | |
print(f"Solution to part 1 is: {len([p for p in passports if all(f in p for f in fields)])}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment