Member-only story

How to Make a Block Comment in Python | Python Tutorial

Multi-line comments in Python with examples

Sanjay Priyadarshi
4 min readDec 7, 2022
Photo by Anete Lūsiņa on Unsplash

Programming languages like C++, Java, and C have built-in to support block comments. When you use those programming languages, you can use multi-line comments if you want.

With the python programming language, there is no built-in mechanism to block comments.

You have to use different conventions to block comments in python.

You can use comments to explain your Python code.

Comments can make your code more readable.

Here we will discuss how you can add block comments in python.

Block comment in Python

Python ignores and does not evaluate comments present in the codebase, making it more readable.

If you’ve ever used a programming language other than Python, you should be aware of two types of code comments.

The first is called a single-line comment, and the second type of comment is called a block comment.

A single-line comment is the most basic way to document your code. With single-line comments, you can reduce the size of your code documentation.

--

--

Sanjay Priyadarshi
Sanjay Priyadarshi

Written by Sanjay Priyadarshi

Join a Community of People Who Love Javascript, Programming and Technology — codertoentrepreneurs.substack.com

No responses yet