Mastery 02 – Comments

When writing code in any programming language, it’s important to make the code readable and clear so other people (include you) can easily maintain and develop the program. One way to do it is to use comments.

In python there are two types of comments:

  1. Single-line comments are created by beginning with the hash (#) character, and they are automatically terminated by the end of line.
    # This is a single-line comment in python

  2. Multi-line comments are created by adding a delimiter (“””) on the beginning and on the end of the comment.
    """ This is a
    multi-line comment
    in python"""


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website at
Get started
%d bloggers like this: