Exemplo n.º 1
0
def day01_02():
    """Run part 2 of Day 1's code"""
    path = "./input/01/input.txt"
    product = product_of_3_sumto2020(file_to_array(path))
    print(f"0102: Product of three numbers summing to 2020: {product}")
Exemplo n.º 2
0
 def test_01(self):
     testlist = file_to_array('tests/input_day01.txt')
     result = gt_previous(testlist)
     expected = 7
     assert expected == result
Exemplo n.º 3
0
def day01_02():
    PATH = "./input/day01.txt"
    inputlist=file_to_array(PATH)
    result=gt_previous_smoothed(inputlist)
    print(f"0102: {result} sums larger than the previous sum.")
Exemplo n.º 4
0
 def test_02(self):
     testlist = file_to_array('tests/input_day01.txt')
     result = gt_previous_smoothed(testlist)
     expected = 5
     assert expected == result
Exemplo n.º 5
0
def day01_01():
    PATH = "./input/day01.txt"
    inputlist=file_to_array(PATH)
    result=gt_previous(inputlist)
    print(f"0101: {result} Measurements larger than the previous measurement.")