SarkariResultess QA Bank

FileNotFoundError का सामान्य समाधान क्या है? इसे debug करने का पहला practical step क्या है?

Other 0 Views Verified
FileNotFoundError का सामान्य समाधान क्या है? इसे debug करने का पहला practical step क्या है?
Sarkari Result QA Bank
Editorially reviewed exam information

Answer & Explanation

4 Answers
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

delete the path

delete the path
Additional Explanation
यह विकल्प सही समाधान नहीं है।
Verified

use None as filename

use None as filename
Additional Explanation
यह विकल्प सही समाधान नहीं है।
Verified

open('/definitely/missing/file.txt')

open('/definitely/missing/file.txt')
Additional Explanation
यह विकल्प सही समाधान नहीं है।