If someone says to me, "Hope you had a good time!" could I then answer "I did!" and it be grammatical?
My first language is French, and I’m wondering if responding that way works in English.
Yes it is. The answer, although simple, contains both a subject and a predicate. Therefore, it is a sentence.
All verbs English can be used in positive statements. However, they need help when it comes to being a part of a negative statement or a question. This help is found in "auxiliary" verbs. In the following examples, the auxiliary is the verb "to do":
ex: "Ann likes ice cream." (a simple positive statement)
"Does Ann like ice cream?" (a question)
"Ann does not like ice cream." (a negative statement)
That auxiliary verb is also what we use in a short answer of this type.
ex: "Does Ann like ice cream?" "Yes, she does". "I think Ann likes ice cream." Yes, she does."
Be careful, the verb "to be" is also used as an auxiliary verb:
ex: "Is Ann hungry?" "Yes, she is". "Ann must be hungry." "Yes, she is."
"I hope you understood." "Yes, I did!"