Space Python Loading Python…

The global Keyword

 
0:00 / 0:00

Challenge

Practise what this example shows: fix or write code until the tests pass.

Launch counter crash

Fix the codeMedium 3 stages

record_launch() 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 function the same way.

Start the challenge

Discussion

Stuck on this example or want to go further? Ask here, or see what others asked.

Log in to ask and reply.

script.py
PythonLn 1, Col 1Spaces: 4
Loading the Python environment…

Separate arguments with commas. They're passed on every Run as sys.argv[1:].