"They liked the city."
Translation:Τους άρεσε η πόλη.
In addition to D_..'s explanation please remember to use the Drop Down hints which show which words are to be used. You will see "η πόλη" at the top of the list because that is correct in this sentence.
"την πόλη" is there because it could be used in another sentence. Just as a dictionary may have many definitions not each one is correct for each sentence.
Duo helps the learner by putting the correct one at the top.
Why "τους" instead of "αυτοι"?
αρέσω is more or less "appeal" -- so the sentence is "the city appealed to them", with η πόλη "the city", the subject, in the nominative case, and τους "to them" a sort of indirect object, which uses the genitive case for personal pronouns.