it first. In Kali Linux, the command that you should use is “chmod”.
Important Note: To learn more about Linux permissions, please check this site:
https://www.linux.com/learn/understanding-linux-file-permissions.
The code that you must type is:
chmod 755 sample.py
After issuing that command using a terminal, your screen will show you this:
Hi, Chuck Norris!
How to Add a Comment
You can add comments to your Python codes. In programming, a comment is a word,
sentence, or paragraph that defines what a piece of code can do. It doesn’t affect the
functionality or behavior of the code itself. Adding a comment to your codes isn’t required
but nonetheless advised. Comments will help you remember important information
regarding your codes. Obviously, you don’t want to forget the “internal mechanisms” of
your own programs.
The interpreter of Python skips each comment. That means the interpreter will jump over
words, sentences or paragraphs until it finds a legitimate code block. In Python, you need
to use “#” to set a single-line comment. For multiline comments, you must type three
double quotes. These symbols must appear at the beginning of your comments.
Here are some comments written in the Python language:
1. # Hi, I’m a single-line comment.
2. “””
Hi,
I’m
A
Multiline
Comment
“””
Important Note: To learn more about Linux permissions, please check this site:
https://www.linux.com/learn/understanding-linux-file-permissions.
The code that you must type is:
chmod 755 sample.py
After issuing that command using a terminal, your screen will show you this:
Hi, Chuck Norris!
How to Add a Comment
You can add comments to your Python codes. In programming, a comment is a word,
sentence, or paragraph that defines what a piece of code can do. It doesn’t affect the
functionality or behavior of the code itself. Adding a comment to your codes isn’t required
but nonetheless advised. Comments will help you remember important information
regarding your codes. Obviously, you don’t want to forget the “internal mechanisms” of
your own programs.
The interpreter of Python skips each comment. That means the interpreter will jump over
words, sentences or paragraphs until it finds a legitimate code block. In Python, you need
to use “#” to set a single-line comment. For multiline comments, you must type three
double quotes. These symbols must appear at the beginning of your comments.
Here are some comments written in the Python language:
1. # Hi, I’m a single-line comment.
2. “””
Hi,
I’m
A
Multiline
Comment
“””
