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>This should also work:</p>

<pre><code>ListA = StringA.split("a ")[1:]
</code></pre>

<p>The [1:] after the split statement has been added because the part before the first 'a' (which is '')  will be treated as the first element of ListA and you don't want that.</p>

<p>Your output will look exactly like the one you desire:</p>

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

python