Results for “UnboundLocalError”

1 result

  1. Article Python Fundamentals

    Python Functions for Beginners

    …fuel = 100 def burn(amount): fuel = fuel - amount burn(30) UnboundLocalError: cannot access local variable 'fuel' where it is not associated with a value Because there's an assignment to fuel inside…