擅长:python、mysql、java
<p>像这样的?你知道吗</p>
<pre><code>for big_index, cities in enumerate(lst):
for index, char in enumerate(cities):
if char == char.lower() and cities[index+1] != cities[index+1].lower():
lst[big_index] = cities[:index] + "," + cities[index:]
</code></pre>
<p>免责声明**未经测试。因为我没有你所有的数据,我不会尝试,但这应该会给出你描述的输出</p>
<p>**编辑:事实上,看起来您的数据根本没有遵循这些规则。就像注释中的例子一样,<code>Coors Blvd NWAlbuquerque</code>怎么样?不管怎样,除非你改变你的问题,否则我会把密码留在这里</p>