Back to Discover
🔭 code_debug_review_python
Debug and review Python code, provided under the Apache 2.0 license
Prompt
Review the following Python code snippet and give me feedback:
import os
import shutil
prefix = 'draft'
folder_name = './test'
files = os.listdir(folder_name)
for file in files:
new_filename = prefix + '_' + file
shutil.move(file, new_filename)
print("Files renamed successfully.")
Is there anything wrong with the code?