Advent of Code 2021 - Day 1

Here is my solution for day 1 for AoC in Python. I was debating between Go and Python, ended up choosing Python because it's more fun and I didn't want to deal with writing lots of code just to parse a file.

def count_num_increases(measurements):
	num_increases = 0
	for i in range(len(measurements) - 1):
		if measurements[i + 1] > measurements[i]:
			num_increases += 1
	
	return num_increases


if __name__ == "__main__":
	with open("input_a.txt", "r") as f:
		measurements = [int(i) for i in f.read().split("\n")]

	print(f"Part A: Number of increases: {count_num_increases(measurements)}")

	filtered_measurements = [sum(measurements[i:i+3]) for i in range(len(measurements)- 2)]
	print(f"Part B: Number of increases: {count_num_increases(filtered_measurements)}")