0 like 0 dislike
10 views
What is Rstrip() in Python?
in Python Coding by Wooden (1.4k points) | 10 views

1 Answer

0 like 0 dislike

Python provides the rstrip() method which duplicates the string but leaves out the whitespace characters from the end.

The rstrip() escapes the characters from the right end based on the argument value, i.e., a string mentioning the group of characters to get excluded.

The signature of the rstrip() is:

str.rstrip([char sequence/pre>
#Example
test_str = 'Programming    '
# The trailing whitespaces are excluded
print(test_str.rstrip())

 

by Wooden (1.4k points)

No related questions found

Welcome to MathsGee Skills Question and Answer Bank, a platform, where you can ask study questions and receive answers from other members of the community. Help is always 100% FREE!
MathsGee Q&A is the knowledge-sharing community where millions of students and experts put their heads together to crack their toughest homework questions.

Enter your email address:

Popular Courses

Python For First Timers
Python For Everyone