In English, we typically use a comma to separate a quotation from an attributive tag—a tag that tells the reader who is speaking or acting (e.g., “he thought” or “said he”)—even if the quote would usually end in a period. However, if the quote is a question, a question mark needs to be used to show the reader that the sentence is an interrogative sentence.
Here’s a tip: Commas can be tricky, but they don’t have to trip you up. Grammarly’s writing assistant can help you make sure your punctuation, spelling, and grammar are tip-top on all your favorite websites. Try Grammarly for free.
In cases when a question mark is used, there is no need to use a comma as well; instead, the attributive tag should come immediately after the closing quotation marks. Consider the example below:
“Do you want to come to the movies with us?”, Mary asked.
“Do you want to come to the movies with us?” Mary asked.
The comma between the quote and the attributive tag is not required, and should be removed.
The same rule applies to exclamation points. See the examples below:
“I am trying to sleep here!”, my roommate yelled.
“I am trying to sleep here!” my roommate yelled.