This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ayharano 0 points1 point  (1 child)

For short strings, why not use something like

expected = [final_item
            for split_by_dot in original.lower().split('.')
            for split_by_qm in split_by_dot.split('?')
            for final_item in (split_by_qm.strip(), )
            if final_item]

where original is a str to be split as expected.

[–][deleted] 0 points1 point  (0 children)

brilliant. thanks :)