title: Python string append
body: <p>I have a python method that takes a list of tuples of the form (string, float) and
  returns a list of strings that, if combined, would not exceed a certain limit. I am not splitting sentences to preserve the output length, but making sure to stay within a sentence length from the desired output length.</p>
  
  <p>For example:<br>
  s: <code>[('Where are you',1),('What about the next day',2),('When is the next event',3)]</code></p>
  
  <p>max_length : <code>5</code><br>
  output : <code>'Where are you What about the next day'</code>  </p>
  
  <p>max_length : <code>3</code><br>
  output: <code>'Where are you'</code>  </p>
  
  <p>This is what I am doing:</p>
  
  <pre><code>l=0
  output = []
  for s in s_tuples:
     if l &lt;= max_length:
       output.append(s[0])
       l+=len(get_words_from(s[0]))
   return ''.join(output)
  </code></pre>
  
  <p>Is there a smarter way to make sure the output word length does not exceed max_length other than stopping when the length is reached?</p>