Here is an example of a Python script that renames files in a directory: import os # specify the directory…