MCQ Answer

The syntax used to rename a file :

The syntax used to rename a file :

फ़ाइल का नाम बदलने के लिए प्रयुक्त सिंटैक्स:
Topic : File Processing in Python

A. os.rename(existing_name, new_name)

B. fq.name = ‘new_name.txt’

C. os.rename(fp, new_name)

D. os.set_name(existing_name, new_name)




Correct Answer is :

A. os.rename(existing_name, new_name)



Explanation
os.rename(existing_name, new_name) function is used to rename file. Example: import os os.rename("a.txt","b.txt") hear this code rename the a.txt to b.txt
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz