Exemple #1
0
def main():
    """
    Open INPUT text file, split the data into list of integers, calculate the answer and print it.
    :return:
    """
    input_data = utils_2020.open_file(sys.argv[1])

    data = input_data.split('\n')

    list_data = [x for x in data[:-1]]

    print('The answer for day 6 part 1 is {}'.format(day_07_a(list_data)))
Exemple #2
0
def main():
    """
    Open INPUT text file, split the data into list of integers, calculate the answer and print it.
    :return:
    """
    data = utils_2020.open_file(sys.argv[1])

    list_data = data.split('\n')

    int_data = [int(x) for x in list_data[:-1]]

    print('The answer for day 1 part 1 is {}'.format(day_01_a(int_data)))
    print('The answer for day 1 part 2 is {}'.format(day_01_b(int_data)))
Exemple #3
0
def main():
    """
    Open INPUT text file, split the data into list of integers, calculate the answer and print it.
    :return:
    """
    input_data = utils_2020.open_file(sys.argv[1])

    data = input_data.split('\n')

    list_data = [x for x in data[:-1]]

    no_of_valid, valid_passports = day_04_a(list_data)

    print('The answer for day 4 part 1 is {}'.format(no_of_valid))
    print('The answer for day 4 part 2 is {}'.format(
        day_04_b(valid_passports)))
Exemple #4
0
def main():
    """
    Open INPUT text file, split the data into list of integers, calculate the answer and print it.
    :return:
    """
    input_data = utils_2020.open_file(sys.argv[1])

    data = input_data.split('\n')

    # list_data = [x for x in data[:-1]]
    list_data = [x for x in data]

    day_08_a_answer, instr_done = day_08_a(list_data)

    print('The answer for day 6 part 1 is {}'.format(day_08_a_answer))
    print('The answer for day 6 part 2 is {}'.format(day_08_b(list_data, instr_done)))