todoform the european-style filename todoget the fullabsolute file paths todorename the files from this you know the shutil move(function can be used to rename filesits arguments are the name of the file to rename and the new filename because this function exists in the shutil moduleyou must import that module but before renaming the filesyou need to identify which files you want to rename filenames with dates such as spam txt and eggs zip should be renamedwhile filenames without dates such as littlebrother epub can be ignored you can use regular expression to identify this pattern after importing the re module at the topcall re compile(to create regex object passing re verbose for the second argument will allow whitespace and comments in the regex string to make it more readable the regular expression string begins with ^*?to match any text at the beginning of the filename that might come before the date the (( | )?\dgroup matches the month the first digit can be either or so the regex matches for december but also for february this digit is also optional so that the month can be or for april the group for the day is (( | | | )?\dand follows similar logic and are all valid numbers for days (yesthis regex will accept some invalid dates such as and dates have lot of thorny special cases that can be easy to miss but for simplicitythe regex in this program works well enough while is valid yearyou can just look for years in the th or st century this will keep your program from accidentally matching nondate filenames with date-like formatsuch as txt the *?)part of the regex will match any text that comes after the date step identify the date parts from the filenames nextthe program will have to loop over the list of filename strings returned from os listdir(and match them against the regex any files that do not have date in them should be skipped for filenames that have datethe matched text will be stored in several variables fill in the first three todos in your program with the following code#python renamedates py renames filenames with american mm-dd-yyyy date format to european dd-mm-yyyy --snip-loop over the files in the working directory for amerfilename in os listdir(')organizing files