假设我有一本字典
一串
中间有未知数量的空格:
'address: 123 fake street city: new york state: new york population: 500000'
我该怎么去
{'address': '123 fake street',
'city': 'new york',
'state': 'new york',
'population': 500000}
甚至是列表或元组,其效果如下:
['address', '123 fake street'],
['city', 'new york'...]
(1) 假设键总是带有冒号的单字
key:
city:
population:
(2) 假设边缘情况
Address:
可能是“X栋S/W约翰·史密斯转交”