The standard symbol for placing comments in both Python and R is the hash mark, #.
You can also add comments to large blocks of texts by putting three sets of quotation marks - """ - at the beginning of the block and the end of the block. Using triple quotes saves you the trouble of putting hash marks at the beginning of every line, which can be a pain.
So, instead of commenting every line like this
#comment a
#comment b
#comment c
#comment d
you can do this
"""comment a
comment b
comment c
comment d"""
Unfortunately, if you try this in R you will get the error
Error: unexpected string constant in """"""
No comments:
Post a Comment