Lesson Progress
0% Complete

For creating a Python script, select File > New File in the Python Shell to launch the text editor where it is possible to write a program. This article will help write the “Great Day” program to help acquaint readers with the IDLE software.

In the text editor, type this:

Interestingly, the first line would be in red, and the word ‘print’ would be in purple, while "Great Day" would be in green. This enables the software to make the code simple to read. Note that the first line is not an actual part of the code; instead, it is a comment incorporated in the program to improve its readability. The Python interpreter ignores this line. In order to incorporate comments into the program, add a # sign before typing the comment in this manner:

It is also possible to write multiline comments by integrating three single quotes or three double quotes in this manner:  

Select Save As under File in order to save your code. Ensure that it is saved with the .py extension.

That is it! This is the first program related to Python, and the results can be seen by clicking on Run > Run Module or by pressing F5. In the Python Shell, the words Great Day are printed.