हिंदी

Differentiate between write() and writelines(). - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

Differentiate between write() and writelines().

अंतर स्पष्ट करें

उत्तर

  • write() method takes a string as an argument and writes it to the text file.
  • writelines() method is used to write multiple strings to a file. We need to pass an iterable object like lists, tuple etc. containing strings to writelines() method.
shaalaa.com
Writing to a Text File
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 2: File Handling in Python - Exercise [पृष्ठ ३७]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 12
अध्याय 2 File Handling in Python
Exercise | Q 1. c) | पृष्ठ ३७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×