Challenge
Shadowed fuel
refuel() assigns to fuel_kg inside the function, creating a local variable and leaving the global fuel unchanged. Predict the last line, compare both values, fix it by returning the total, then write…
2 results
Challenge
refuel() assigns to fuel_kg inside the function, creating a local variable and leaving the global fuel unchanged. Predict the last line, compare both values, fix it by returning the total, then write…
Challenge
…flight computer keeps one variable up to date instead of creating a new one for each step. Predict how -= and += change a value, follow the fuel through a whole sequence, then track a battery…