NIELIT O Level Exam

What happens if a file opened in w mode already exists?

What happens if a file opened in w mode already exists?

यदि file पहले से मौजूद है और उसे w mode में खोला जाए तो क्या होता है?

A. Error is raised

B. File is appended

C. File is read-only

D. File is overwritten




Correct Answer is :

D. File is overwritten



Explanation
Write mode truncates existing file content before writing.

w mode existing file के पुराने content को हटाकर नया content लिखता है।
Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad