+ 1
Does anyone know why certain code does not work in Code Playground but works OK on the IDLE suggested by SOLOLEARN?
I have some Python 3 code which runs OK on the IDLE suggested by Sololearn, but does not work on Code Playground. It is called " My Basic Calculator" - Mark Spencer
2 ответов
+ 4
You should indent back the lines 50-53 by two tabs. Those *have* to be executed no matter what. Now they are conditioned with other variables being of certain values which may not always be True.
This is why in some cases the 'num2' variable does not get initialized.
+ 2
Thanks very much that makes sense - num2 error no longer occurs