Wrote an article
https://itsmycode.com/how-to-get-file-extension-in-python/