import unittest import os class Day8(unittest.TestCase): inputfile = os.path.join(os.path.dirname(__file__), "input/day8_input") def test_day8a(self): width = 3 height = 2 with open(self.inputfile) as fp: img = [int(k) for k in str(fp.readline())] layers = [img[b:e] for b, e in zip([0, 6], [6, 12])] for l in layers: print(l.count(0)) if __name__ == "__main__": Day8().test_day8a()