B. Le 了is used to ask or answer questions about whether one has done something. (Did you ...? or Have you ...?)
2.1 A: Nǐ chī fàn le ma?
Haven you eaten yet?
B: Chī le.
Yes, I have.
2.2 A: Kèrén lái le ma?
Have the guests arrived yet?
B: Lái le.
Yes, they have.
The Interrogative and the Negative. (The question form may use méi yǒu没有 instead of ma at the end of the sentence. The negative uses méi yǒu没有or méi没 before the verb, and le了 is dropped. If the speaker intends to do something, but has not done it yet, he/she uses ‘hái méi还没 ... ne呢’ meaning ‘have not ... yet’.
2.3 A: Nǐ zuò zuòyè le méi yǒu? = Nǐ zuò zuòyè le ma?
Did you do (or: Have you done) your homework?
B: Méi zuò. (or: Hái méi [zuò] ne.)
做了。（还没 [做] 呢。）
No, I did not. (I haven’t [done it] yet.)