I wanted to eliminate specific characters by using rstrip() function in python, but it didn't work well to me.
Here is the code I wrote.
a = "happy! New! Year!!!"
print(a)
b = a.lower()
print(b)
c = b.rstrip('!')
print(c)
And this is the result.
happy! New! Year!!!
happy! new! year!!!
happy! new! year
The result I wanted was to output "happy new year", but the function just got rid of last three '!'. I have no idea why it happened.