Answer:
a. to protect inhabitants of the city-state from attack
Step-by-step explanation:
The goal in walling a city is to protect the inhabitants from enemy attacks, so the walled cities had very restricted access, often surrounded by water, where they could only enter through gates. Around the world, especially in Europe and Asia, it is easy to find monumental walls, usually built in rocks, that took decades to complete and today are charming tourist attractions with exploration, castle or wall tours, shops and restaurants in medieval squares.