The mayor and council may adopt a code of ordinances and may amend and repeal the same, or any part thereof.