Exam PCAP All QuestionsBrowse all questions from this exam
Question 71

If S is a stream open for reading, what do you expect from the following invocation?

    Correct Answer: B

    The read() method reads the entire content of the file, from the current position of the file pointer until the end of the file, and stores it in the variable 'c' as a string. If no argument is provided to the read() method, it defaults to reading the entire file.

Discussion
macxszOption: B

B. the whole file content will be read and stored in the string called C

Seb1988

correct

aykhazri

correct

seaverickOption: B

s=open('module1.py','rt') c=s.read() print(c) Ans is B

AmfortasOption: B

...The read() method returns the specified number of bytes from the file. Default is -1 which means the whole file...