मराठी

How is write() different from writelines()?

Advertisements
Advertisements

प्रश्न

How is write() different from writelines()?

अति संक्षिप्त उत्तर
Advertisements

उत्तर

write() writes one string to a file. writelines() writes a sequence of strings, such as a list or tuple. Neither method automatically adds a newline character; \n must be included explicitly.

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 7: Data File Handling - EXERCISE [पृष्ठ १४५]

APPEARS IN

सीबीएसई Computer Science with Python [English] Class 12
पाठ 7 Data File Handling
EXERCISE | Q 5. | पृष्ठ १४५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×