Code executor not working

While ChatGPT is able to generate perfectly executable code, it is giving error analyzing when executing the code.

As shown above, I’m able to execute this code in my local python env, but the code executor isn’t working.