Unzip multiple .gz files with Python

I am trying to unzip a batch of files with .gz extension in a directory using Python 3. Each zip file has a with .tif extension inside. So the zip files are named like filename.tif.gz and the files inside are named like filename.tif. I want to extract them all in the same directory. I am using Jupyter Notebook thus don't need to specify the directory path.

I have tried using the zipfile and gzip packages. The zipfile package code comes with an error and the gzip package code does nothing. The zipfile package code I have tried is as follows-

for file in os.listdir ("."):
    if file.endswith ("gz"):
        zip_ref = zipfile.ZipFile (file, "ab")
        zip_ref.extractall ()
        zip_ref.close ()

The code exerts a ValueError that the "ZipFile requires mode 'r', 'w', 'x' or 'a'." I expect to just extract all the .gz zipfiles, just like what the 7zip or WinRAR program does.