lstrip rstrip python code example
Example 1: rstrip in python
text = " Apple "
x = txt.rstrip()
>>> ' Apple'
x.rstrip('e')
>>> ' Appl'
x.lstrip()
>>> 'Apple'
Example 2: rstrip python
txt = " banana "
x =
txt.rstrip()
print("of all fruits", x, "is my favorite")