Results for “UnboundLocalError”

3 results

  1. Challenge

    Launch counter crash

    …adds 1 to a global counter and stops with an UnboundLocalError. Predict it, find out why Python treats the name as local, fix it by passing the count in and returning the new one, then write a fuel…

    Fix the code Medium 3 stages functions scope UnboundLocalError global
  2. 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…