4a - Introduction to Python
4a - Introduction to Python
COMMENTS
Take note of the hash sign before and the colon that comes
after the word Filename.
Also notice the .py extension after the name of the file.
In Python, the hash is reserved for comments.
A comment is a string typed in a program which will be
ignored by the program when it is run.
A full explanation of comment is the subject of a separate
lecture.
© H. Chiname 2023. Version 05
Activity 4 Solution: Adding the File Name
For all the programs that you will create, the Filename
should always, always be the first line that you type in
your program!
Take note how the comment appears in a red font
colour.
Also notice how Python prompts you to save your
program if you try to run it without first saving it.
Constantly saving your work as you create your
programs cannot be stressed enough. It is a key
component of programming skills!