Initial setup

This commit is contained in:
2020-12-06 23:33:55 +01:00
parent 719c643b03
commit e011ff8444
13 changed files with 2817 additions and 0 deletions

27
Scripts/Day4_1.py Normal file
View File

@@ -0,0 +1,27 @@
f = open("Ressources/InputDay4.txt", 'r')
input = ""
for line in f:
if not line.isspace():
input += line
else:
input += 'ü'
input = input.replace("\n", "")
passports = input.split('ü')
requiered = ["byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"]
valid = 0
for passport in passports:
matches = 0
for requierdInfo in requiered:
if requierdInfo in passport:
matches += 1
if matches == len(requiered):
valid += 1
print(valid)