I am new to python and question may sound silly but I wanted to clear it. While learning I came across code where python is allowing triple quotes(""") both as multi-line comment and also as string literal. So how does python knows if it is intended as comment or a string literal.
"""This
is treated
as comment
and ignored"""
a = """It is
treated as
string literal"""
print(a)
Output:-
It is
treated as
string literal