<jupyter_start><jupyter_text>Advent of Code 2019 - Day 1 Part 1<jupyter_code>total_fuel = 0
with open('input.txt', 'r') as f:
    for mass in [int(i) for i in f]:
        module_fuel = int(mass / 3) - 2
        total_fuel = total_fuel + module_fuel
        
print(f'Part 1 fuel needed: {total_fuel}')<jupyter_output>Part 1 fuel needed: 3275518<jupyter_text>Part 2<jupyter_code>def get_fuel_reqs(mass):
    fuel = int(mass / 3) - 2
    
    if fuel <= 0:
        return 0
    else:
        return fuel + get_fuel_reqs(fuel)
 
print(f'Test data: {get_fuel_reqs(1969)}')
total_fuel = 0
with open('input.txt', 'r') as f:
    for mass in [int(i) for i in f]:
        total_fuel = total_fuel + get_fuel_reqs(mass)
        
print(f'Part 2 fuel needed: {total_fuel}')<jupyter_output>Part 2 fuel needed: 4910404
{'fraction_non_alphanumeric': 0.11970074812967581, 'fraction_numerical': 0.046134663341645885, 'mean_word_length': 3.2263157894736842, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '238445', 'license': 'MIT', 'n_tokens_mistral': 356, 'n_tokens_neox': 307, 'n_words': 83, 'path': '2019/01/solution.ipynb', 'repo_name': 'MWers/advent-of-code', 'size': '802'}