def get_mass_with_fuel(module_mass): fuel_mass = get_mass(module_mass) total_fuel = fuel_mass while fuel_mass > 0: fuel_mass = get_mass(fuel_mass) if fuel_mass < 0: fuel_mass = 0 total_fuel += fuel_mass return total_fuel
def test_12(self): self.assertEqual(2, get_mass(12))
def test_1969(self): self.assertEqual(654, get_mass(1969))
def test_100756(self): self.assertEqual(33583, get_mass(100756))
def test_14(self): self.assertEqual(2, get_mass(14))