Advertisements
Advertisements
प्रश्न
Differentiate between readline() and readlines().
अंतर स्पष्ट करें
Advertisements
उत्तर
readline() command enables you to read per line in a content and readlines() command is used to read all the content present in a file at the same time and gives list of that item. The readline method extracts a single line from a file and returns it as a string. The readlines method returns a list of strings containing the contents of the entire file, with each object representing one line of the file. With read, you can also review the full file into a substring.
shaalaa.com
Reading from a Text File in Python
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
