Home / Questions / Other FileNotFoundError का सामान्य समाधान क्या है? कौन सा code pattern सही समाधान है? — error आने पर developer क्या करे? Other 0 Views Verified FileNotFoundError का सामान्य समाधान क्या है? कौन सा code pattern सही समाधान है? — error आने पर developer क्या करे? #python #error #debugging #exception #solution Sarkari Result QA Bank Editorially reviewed exam information Share
Verified open('/definitely/missing/file.txt') open('/definitely/missing/file.txt') Additional Explanation यह विकल्प सही समाधान नहीं है।
Verified Correct Answer path = Path('data.txt') if path.exists(): text = path.read_text(encoding='utf-8') path = Path('data.txt') if path.exists(): text = path.read_text(encoding='utf-8') Additional Explanation सही path और existence check करें। पहले traceback की exact line और input value check करें।
Verified use None as filename use None as filename Additional Explanation यह विकल्प सही समाधान नहीं है।