You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.6 KiB

REVERSE!

In [7]:
from textblob import TextBlob

def reverse (inputz: str) -> str:
    """Reverse the input sentence by sentence"""
    blob = TextBlob(inputz)
    return "\n".join(str(reversed(blob.sentences)))
        
    # return " ".join(reversed(inputz.split()))
In [8]:
reverse("hello world")
Out[8]:
'<\nl\ni\ns\nt\n_\nr\ne\nv\ne\nr\ns\ne\ni\nt\ne\nr\na\nt\no\nr\n \no\nb\nj\ne\nc\nt\n \na\nt\n \n0\nx\na\nc\n4\na\nf\n3\n9\n0\n>'