human
I'm a little confused about the difference between a comma and a semicolon. Can you explain them to me?
assistant
A comma is used to separate items in a list, while a semicolon is used to separate independent clauses within a sentence. For example: "The dog ran, barking loudly; the cat sat, purring."