Report this

What is the reason for this report?

Sihat is the difference between three quotation marks and hash in phyton

Posted on March 9, 2021

Two ways used in phyton to differentiate comment statement with a line of command code



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

""" also lets you do multi-line comments

"""
Multi
Line
Comment
"""

Hi @Dalisha,

Usually, in Python, when you want to comment something, as you’ve mentioned you used the hash symbol - #.

In regards to Quotation marks, they are used when you want to specify some string, text or similar stuff. Let me show you an example:

Quotation marks

variable = "This is a string"

Comment

# The bellow variable is commented by the use of the hash symbol. 
# variable = "This is a string"

Regards, KFSys

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.