>>> t1 = "abcd.org.gz" >>> t1 \'abcd.org.gz\' >>> t1.strip("g") \'abcd.org.gz\' >>> t1.strip("gz")
strip(".gz") removes any of the characters ., g and z from the beginning and end of the string.
strip(".gz")
.
g
z