+ 1
Multi-line comments in Python
So when i'm trying to write a multi-line comment on the first line, it look like a comment, it's grey you know. But when i'm trying to write a multi-line comment in the middle of the code it turns out green, why is this happening?
1 Réponse
+ 2
Triple-quoted strings can also be string literals that extend across lines. They have two features (and a whole bunch of "subfeatures"), commenting (usually reserved for docstrings) and string literals. For example, this works:
string = """I'm a
triple-quoted
string literal!"""
but this doesn't:
string = "I'm a
single-quoted
invalid string literal..."