Python: Cut off the last word of a sentence?
Python: Cut off the last word of a sentence? Question: What’s the best way to slice the last word from a block of text? I can think of Split it to a list (by spaces) and removing the last item, then reconcatenating the list. Use a regular expression to replace the last word. I’m currently …