Home / Questions / Other FileNotFoundError का सामान्य समाधान क्या है? इसका Python best-practice solution क्या है? Other 0 Views Verified FileNotFoundError का सामान्य समाधान क्या है? इसका Python best-practice solution क्या है? #python #error #debugging #exception #solution Sarkari Result QA Bank Editorially reviewed exam information Share
Verified use None as filename use None as filename 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 करें।
Verified open('/definitely/missing/file.txt') open('/definitely/missing/file.txt') Additional Explanation यह विकल्प सही समाधान नहीं है।