Question

QUESTION 2 This is a MULTIPLE ANSWER question, which means you are able to select one...

QUESTION 2

This is a MULTIPLE ANSWER question, which means you are able to select one or more answers as being correct. Note that this does not necessarily mean that there are multiple correct answers. In any case, select all the answers you believe are correct. (NB: There are no part marks awarded for multiple answer questions.)

This question is designed to test your ability to find and interpret Python documentation.

There is a Python function shown in the Python documentation as follows:

open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None,closefd=True, opener=None)

Which of the following are built-in functions (methods) that can be used on the value that is returned from a successful call to the open function (assuming the appropriate mode is used)?

close

tell

write

read

seek

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

The open() function returns a file object which can used to read, write and modify file. Here, 'r' mode is used which means 'open a file for reading only'.

Following are built-in functions (methods) that can be used on the value that is returned from a successful call to the open function in 'r' mode:

close() : The close() method is used to close the file, close method clear all buffer and close the file.

read() : The read() method just outputs the entire file if number of bytes are not given in the argument.

Please give thumbsup, if you like it. Thanks.

Add a comment
Know the answer?
Add Answer to:
QUESTION 2 This is a MULTIPLE ANSWER question, which means you are able to select one...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT