Wednesday, June 12, 2024

Running code: the console: this is a partial quote from:https://www.khanacademy.org/computing/intro-to-python-fundamentals/x5279a44ae0ab15d6:computational-thinking-with-variables/x5279a44ae0ab15d6:the-programming-platform/a/using-the-development-environment

 begin partial quote from:

https://www.khanacademy.org/computing/intro-to-python-fundamentals/x5279a44ae0ab15d6:computational-thinking-with-variables/x5279a44ae0ab15d6:the-programming-platform/a/using-the-development-environment

Running code: the console

Now that we've written our program, what do we do with it?
A user runs a program in the Khan Academy IDE by pressing the Run button. An interactive input prompt appears in the console that the user responds to. The user edits the code and runs the program again, and this time a red error message appears in the console.
At the top of the IDE, you'll see a big green Run button. When we press Run, it submits the program to the computer to execute. Think of this like handing in an assignment; we're telling the computer that we're ready for it to take a look now. In this case, though, there's no penalty for mistakes, so we should run our program early and often!
As it executes the program, the computer displays any results in the console. This output then stays displayed in the console until the next time we press Run - it does not automatically update.
Console output might be a result that the program asked the computer to display, or it might be an error that the computer encountered while executing the program. Not every program has output, so it's also possible the console stays empty.

No comments: