Here are some things to think about:What does os.listdir return?When loop array what is file?When calling os.rename what does it expect the src & dst to be?what are you actually calling os.rename with when you are doing os.rename(file,file +str(x))?