human
I'm a bit confused about the difference between a comma and a semicolon. Can you explain the difference to me?
assistant
A comma is used to separate independent clauses within a sentence, while a semicolon is used to join two related independent clauses in a single sentence. For example, "The dog ran after the cat, which was chasing the mouse." In this sentence, there are three independent clauses: 1) The dog ran after the cat; 2) the cat was chasing the mouse; 3) the mouse ran into the hole.