with open('puzzle.txt', 'r') as f: instructions = f.read().splitlines() lights = { x: { y: { 'light_state': True } for y in range(1000) } for x in range(1000) } print(lights)