ExamLookup
Menu mobile
Home
Current Affairs
General Knowledge
Computer
Python
HTML
Programming and Problem Solving through Python
: File Processing in Python
फ़ाइल का नाम बदलने के लिए प्रयुक्त सिंटैक्स: , The syntax used to rename a file :
The syntax used to rename a file :
A.
os.rename(existing_name, new_name)
os.rename(existing_name, new_name)
B.
fq.name = ‘new_name.txt’
fq.name = ‘new_name.txt’
C.
os.rename(fp, new_name)
os.rename(fp, new_name)
D.
os.set_name(existing_name, new_name)
os.set_name(existing_name, new_name)
Solution
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)
O Level NIELIT Study material and Quiz
Bank SSC Railway TET UPTET Question Bank
career counselling in allahabad
Sarkari Exam Quiz
Website development Company in Allahabad