>>> t1 = "abcd.org.gz" >>> t1 \'abcd.org.gz\' >>> t1.strip("g") \'abcd.org.gz\' >>> t1.strip("gz")
The argument given to strip is a set of characters to be removed, not a substring. From the docs:
strip
The chars argument is a string specifying the set of characters to be removed.