rstrip() python code example
Example 1: what is r strip function in python
str = " this is string example....wow!!! ";
print str.rstrip()
str = "88888888this is string example....wow!!!8888888";
print str.rstrip('8')
Example 2: rstrip in python
text = " Apple "
x = txt.rstrip()
>>> ' Apple'
x.rstrip('e')
>>> ' Appl'
x.lstrip()
>>> 'Apple'
Example 3: rstrip python3
s = "Hello There "
a = "s"
print(s.rstrip())
print(s.rstrip(a))
Example 4: rstrip python
txt = " banana "
x =
txt.rstrip()
print("of all fruits", x, "is my favorite")