AdventOfCode2020/day3.py
2022-12-17 20:35:26 +01:00

41 lines
631 B
Python

day = "day3"
file = f"inputs/{day}.txt"
array = []
def part_one(file):
result = 0
input = open(file, "r")
input = input.readlines()
newInput = []
for line in input:
temp = 10*line
newInput.append(temp)
print(newInput[0])
startIndex=0
for line in newInput:
if(line[startIndex] == '#'):
result += 1
if startIndex <= len(line) -10:
startIndex +=3
print(f"Part 1: {result}")
part_one(file)
def part_two(file):
result = 0
input = open(file, "r")
input = input.readlines()
print(f"Part 2: {result}")
part_two(file)