SarkariResultess QA Bank

Path का existence check कैसे करें? — error आने पर developer क्या करे?

Other 0 Views Verified
Path का existence check कैसे करें? — error आने पर developer क्या करे?
Sarkari Result QA Bank
Editorially reviewed exam information

Answer & Explanation

4 Answers
Verified

Path.exists('data.txt')

Path.exists('data.txt')
Additional Explanation
यह विकल्प सही समाधान नहीं है।
Verified Correct Answer

Path('data.txt').exists()

Path('data.txt').exists()
Additional Explanation
Path.exists() path मौजूद है या नहीं बताता है। पहले traceback की exact line और input value check करें।
Verified

Path('data.txt').is_exists()

Path('data.txt').is_exists()
Additional Explanation
यह विकल्प सही समाधान नहीं है।
Verified

exists(Path,'data.txt')

exists(Path,'data.txt')
Additional Explanation
यह विकल्प सही समाधान नहीं है।