How do you rename a file?
A. fp.name = ‘new_name.txt’
B. os.rename(existing_name, new_name)
C. os.rename(fp, new_name)
D. os.set_name(existing_name, new_name)
Answer:A
How do you rename a file?
A. fp.name = ‘new_name.txt’ B. os.rename(existing_name, new_name) C. os.rename(fp, new_name) D. os.set_name(existing_name, new_name)
Explanation: os.rename() is used to rename files.