SarkariResultess QA Bank

File में text लिखने का तरीका क्या है? — error आने पर developer क्या करे?

Other 0 Views Verified
File में text लिखने का तरीका क्या है? — error आने पर developer क्या करे?
Sarkari Result QA Bank
Editorially reviewed exam information

Answer & Explanation

4 Answers
Verified Correct Answer

with open('data.txt', 'w', encoding='utf-8') as f: f.write('Hello')

with open('data.txt', 'w', encoding='utf-8') as f: f.write('Hello')
Additional Explanation
w mode file को write के लिए खोलता है। पहले traceback की exact line और input value check करें।
Verified

open.write('data.txt')

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

write('data.txt','Hello')

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

file.write('data.txt')

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