Home / Questions / Other Python में text file read करने का सही तरीका क्या है? — error आने पर developer क्या करे? Other 0 Views Verified Python में text file read करने का सही तरीका क्या है? — error आने पर developer क्या करे? #python #python programming #coding #developer Sarkari Result QA Bank Editorially reviewed exam information Share
Verified Correct Answer with open('data.txt', 'r', encoding='utf-8') as f: text = f.read() with open('data.txt', 'r', encoding='utf-8') as f: text = f.read() Additional Explanation with open context manager file को safely close करता है। पहले traceback की exact line और input value check करें।
Verified file.read('data.txt') file.read('data.txt') Additional Explanation यह विकल्प सही समाधान नहीं है।
Verified open_file('data.txt') open_file('data.txt') Additional Explanation यह विकल्प सही समाधान नहीं है।
Verified with file('data.txt'): with file('data.txt'): Additional Explanation यह विकल्प सही समाधान नहीं है।