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

21
Scripts/Day2_2 copy.py Normal file
View File

@@ -0,0 +1,21 @@
f = open("Ressources/InputDay2.txt", 'r')
input = f.readlines()
indexes = []
chars = []
passwords = []
for i in input:
index, char, password = i.split(" ")
indexes.append(index)
chars.append(char[0])
passwords.append(password.strip())
validPasswords = 0
for (password, char, index) in zip(passwords, chars, indexes):
if (password[int(index.split('-')[0])-1] == char) ^ (password[int(index.split('-')[1])-1] == char):
validPasswords += 1
print(validPasswords)