Is there a method of ending single line comments in python?
Something like
/*This is my comment*/ some more code here...
Is there a method of ending single line comments in python?
Something like
/*This is my comment*/ some more code here...
No, there are no inline comments in Python.
From the documentation:
Whitespace in Python is too important to allow any other kind of comment besides the
#
comment that goes to the end of the line. Take this code:Because indentation determines scope, the parser has no good way of knowing the control flow. It can't reasonably eliminate the comment and then execute the code after it. (It also makes the code less readable for humans.) So no inline comments.