human
How do I know when to use a comma versus a semicolon in a sentence?
assistant
When you are writing a sentence, it is important to use commas and semi-colons correctly. A comma should be used when the sentence could be broken up without changing the meaning of the sentence. For example, "I like apples, bananas, and pears" is correct because each fruit is an independent clause that does not affect the rest of the sentence. A semi-colon can be used instead of a comma if there is a break within the sentence that needs clarification or emphasis. For example, "I like apples; bananas; and pears."