PCAP Exam QuestionsBrowse all questions from this exam

PCAP Exam - Question 71


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

Show Answer
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

5 comments
Sign in to comment
aykhazri
May 14, 2021

correct

Seb1988
Jun 14, 2021

correct

macxszOption: B
May 3, 2022

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

AmfortasOption: B
Aug 30, 2022

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

seaverickOption: B
Feb 4, 2024

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