Skip to content
Advertisement

Commenting print() breaks the Python code

I was faced with a very strange problem. With print() this code works.

JavaScript

If I comment or delete the 10-th line with print() I got an error:

JavaScript

Process finished with exit code 1

I use Python 3.9. PyCharm. I tried to launch with different virtual environments with Python 3.8 and 3.10 – the same error. When I launch in Jupyter and Colab – it is fane – no error.

There are no issues with any other Python script. I used the installation for several months and there was nothing strange.

It is so strange that I have no idea. Could you please help me?

Advertisement

Answer

Thank you all for helping to refer me in the right direction. The reason for the error was a bug in PyCharm. It sent not was typed. The issue disappeared after the PyCharm update from version 2022.1.1 to 2022.1.2.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement