Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass

JeffersGlass/day4_part1.py Secret

Created Dec 4, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.