हिंदी

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×