This isn't an answer, more just a general comment. At first your answer did seem unclear, and then I flashed back on when I first started doing programming, and I thought at the time that there should be a list of the rules of the language C, the way that there's a list of the rules of the game of chess.
However, there really isn't such a list of rules for programmer usage. Interpreters (or compilers in the case of compiled languages) do have a list of rules, but I don't think it's terribly helpful for an actual programmer. You could go through the spec yourself,for example at
https://docs.python.org/3/reference/lexi...delimiters it says this about double-quotes ("), "The following printing ASCII characters have special meaning as part of other tokens or are otherwise significant to the lexical analyzer:
' " # \"
Mostly you just have try out examples, and see what works and what doesn't, and infer the rules from that.
But @
ichabod801 gave a more direct answer to your question.