Question

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

Posted March 9, 2021 142 views
PythonDevelopment

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

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.

×
Submit an Answer
2 answers

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

""" also lets you do multi-line comments

"""
Multi
Line
Comment
"""