1.

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)This question was addressed to me in an online quiz.This question is from Files in chapter Regular Expressions and Files of Python

Answer»

The correct ANSWER is (B) os.RENAME(existing_name, new_name)

Best explanation: os.rename() is used to rename FILES.



Discussion

No Comment Found

Related InterviewSolutions