I have a folder on ArcGIS Online for a city that has few layers in it. I need to create separate folders for each city and then create new feature layers using these existing layers, preferably using Python script. I'm stuck right as I don't know how to create new feature layer from existing layer using Python (also, this new layer shouldn't be linked to the existing layer. The configuration should be exact same with only difference that they should have separate id's).
from arcgis.gis import GIS
gis = GIS("https://www.arcgis.com", username, password)
# Log into ArcGIS Online
gis = GIS('home')
#Town input from user
town_name = input('Enter town name: ')
town_abr = input('Enter town initials/Site id: ')
#creating town folder
gis.content.create_folder(folder='STR_{}'.format(town_name))
search_result = gis.content.search(query="title:STR_ENK1_COL_Duct Route Existing", item_type="Feature Layer")
(search_result[0]).id
existing_layer = gis.content.get('f21d1f7edbce478e88782e5a29728c11')