Report Bug
Qus : What happens when this code is executed?
Qusनिम्न code execute करने पर क्या होगा?

A. Data is written successfully
B. File content is overwritten
C. Raises an exception
D. Nothing happens


Solution
C. Raises an exception



Explanation
A file opened in read-only (r) mode cannot be written to.

r mode में खुली file केवल पढ़ी जा सकती है; उसमें write करने पर exception आएगा।



Report Bug