streetList = [ "13 Kent Street Gordon", "22 King Road Soho", "123 Kong Lane Foggy Bottom", "76 Inglis Avenue Don't Go Here", "300 4th Street Adams Morgan"] kindList = ["Street", "Road", "Lane", "Avenue", "Trail"] newList = [] for street in streetList: for kind in kindList: if kind in street: where = street.find(kind) kindLen = len(kind) div = where + kindLen streetPart = street[:div] suburbPart = street[div:] newList.append([streetPart, suburbPart]) print newList
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.