Python: How to make a string to a list using a substring?
<p>For example I have a string like this...</p>

<pre><code>StringA = "a city a street a room a bed"
</code></pre>

<p>I want to cut this string using a substring <code>"a "</code> and make a <code>list</code> from it. So the result looks like...</p>

<pre><code>ListA = ["city ", "street " ,"room " ,"bed"]
</code></pre>

<p>It would be OK if there are some empty spaces left. How can I do this? Thanks!</p>

<p>You can do it in one line:</p>

<pre><code>filter(len, "a city a street a room a bed".split("a "))
</code></pre>

python