rstrip()
method which duplicates the string but leaves out the whitespace characters from the end.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.rstrip()
is :str.rstrip([char sequence/pre>
#Example
test_str = 'Programming '
# The trailing whitespaces are excluded
print(test_str.rstrip())