title: How to separate a string with commas after vowel or space and append to an array?
body: <p>I need to add a comma after a vowel or space in a string and append it to an array.
  I tried this but does not give me what I want.
  For e.g if I enter &quot;a mambo jambo&quot; output should be ['a', 'ma', 'mbo', 'ja', 'mbo'] .</p>
  <p>This is my code:</p>
  <pre><code>text = input(&quot;Please enter text : &quot;)
  vowel = [&quot;a&quot;, &quot;e&quot;, &quot;i&quot;, &quot;o&quot;, &quot;u&quot;]
  final_string = []
  not_vowel = &quot;&quot;
  a_vowel = &quot;&quot;
  for text_in in text:
      if text_in not in vowel:
          not_vowel = text_in
      if text_in in vowel:
          a_vowel = text_in
      final_string.append(f'{not_vowel}{a_vowel}')
  
  print(final_string)
  </code></pre>
  <p>And this is the output after input &quot;a mambo jambo&quot;:</p>
  <pre><code>['a', ' a', 'ma', 'ma', 'ma', 'ba', 'bo', ' o', 'jo', 'ja', 'ma', 'ba', 'bo']
  </code></pre>
  <p>what I want is</p>
  <pre><code>['a', 'ma', 'mbo', 'ja', 'mbo']
  </code></pre>