I would like to create a python function where I pass as arguments the name and the directory path of some files which I want to rename; something like def my_fun (name, path):  The directory path is the same for each file. I did it in this way but I cannot turn it into a function form as I look for.
path = input("tap the complete path where files are")
for name in files_names:
    name = input("insert file name as name.ext")
    old_name = os.path.join(path, files_names)
    new_name = os.path.join(path, name)
    os.rename(old_name, new_name)
 
    