How come python reacts to indentations of a comment?
def foo():
\"\"\"
Random comment
\"\"\"
return True
works, but:
The triple-quoted string is not a comment, it is a string literal. It's not assigned or used in any way by your code, but it's still a regular string and has to fit the syntax of Python. (In this case it happens to be the docstring, but that has nothing to do with whether indentation matters for it or not.)
#
is the way to get comments.