
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How do we create multiline comments in Python?
Comment is a piece of text in a computer program that is meant to be a programmer-readable explanation or annotation in the source code and not ignored by compiler/interpreter. In Python script, the symbol # indicates start of comment line.
C like block comment (/* .. */) is not available in Python. If more than one consecutive line are to be commented, # symbol must be put at beginning of each line
##comment1 ##comment2 ##comment3 print ("Hello World")
A triple quoted multi-line string is also treated as comment if it is not a docstring of a function or class.
''' comment1 comment2 comment3 ''' print ("Hello World")
- Related Articles
- How do we provide comments in Python?
- How do we use single line comments in JavaScript?
- How do we use multi-line comments in JavaScript?
- How do we create python string from list?
- How to create hidden comments in HTML?
- How to create conditional comments in HTML?
- How to create a multiline entry with Tkinter?
- How can we write a multiline lambda expression in Java?
- How do we create underlined text in HTML?
- How do we create preformatted text in HTML?
- How do we create a structure in C#?
- Comments in Python
- How to create a multiline input control text area in HTML5
- How do we create a sub window in HTML?
- How do we create an image map in HTML?

Advertisements