For the gold challenge, use os.splitext() to get the extension of file and store it in extension. Further below, add it to new_filename.

Psst: you can also use the split() function to split file into a list and use its last item.