Report Bug

QusWhich mode creates a new file if the file does not exist? Qusयदि फ़ाइल मौजूद नहीं है तो कौन सा मोड एक नई फाइल बनाता है?


A. write mode
B. read mode
C. append mode
D. Both (A) And (B)


Solution
A. write mode



Explanation

In Python, the "w" (write) mode is used to open a file for writing. If the file specified in the open function does not exist, it will create a new file. If the file already exists, opening it in write mode will truncate the file to zero length, effectively erasing its content.

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad