If S is a stream open for reading, what do you expect from the following invocation?
If S is a stream open for reading, what do you expect from the following invocation?
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.
B. the whole file content will be read and stored in the string called C
correct
correct
s=open('module1.py','rt') c=s.read() print(c) Ans is B
...The read() method returns the specified number of bytes from the file. Default is -1 which means the whole file...