She has lived in this city for her whole life.
For the above sentence, can I write,
She has lived in this city her whole life.
If yes, is there any difference between them?
She has lived in this city for her whole life.
For the above sentence, can I write,
She has lived in this city her whole life.
If yes, is there any difference between them?
Phrases which describe a duration of time, or end with less than, more than, or fewer than often omit the preposition for. This is a very common idiomatic usage in everyday speech, and not governed specifically by a rule of grammar.
For example:
She was only here (for) a week.
Don't watch television (for) more than two hours.
I've been waiting (for) less than a day.
I was only gone (for) an hour.
I slept there (for) fewer than three nights.
In your example, both versions have the same meaning. In formal writing and for clarity, it is probably best to include the "for."
Note: this question has a rich history here. This link may yield further insights. A question at ELU, found here, provides even more food for thought.
Yes, in this particular case, you can leave out "for". There's really no difference between the two.