When you start IDLE, it's in interactive mode (Python shell). You can tell, because there is
In interactive mode the code is executed immediatelly and you will need to type everything over and over again. What you want is to write your code and save it as an .py file
Now go to File->New File will open new window. This is where you should write your code and save it before you run it. In this second window there is Run menu.
When you run the file you saved, the result will be visible in the Python shell.
All that said IDLE is considered very poor editor.
also you may want to check different options to run your code
https://python-forum.io/Thread-How-to-Ex...ython-code
>>>
. Window title is Python shellIn interactive mode the code is executed immediatelly and you will need to type everything over and over again. What you want is to write your code and save it as an .py file
Now go to File->New File will open new window. This is where you should write your code and save it before you run it. In this second window there is Run menu.
When you run the file you saved, the result will be visible in the Python shell.
All that said IDLE is considered very poor editor.
also you may want to check different options to run your code
https://python-forum.io/Thread-How-to-Ex...ython-code
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs