"""Simulate unreasonably many lanternfish pop growth""" fishes = {x: 0 for x in range(9)} with open("6_input.txt") as f: for age in [int(x) for x in f.read().split(",")]: fishes[age] += 1 for day in range(100000): print(day) next_day_fishes = {x: 0 for x in range(9)} next_day_fishes[8] = fishes[0] next_day_fishes[6] = fishes[0] for i in range(8): next_day_fishes[i] += fishes[i+1] fishes = next_day_fishes print(fishes) print(sum(fishes.values()))