Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP All Questions

View all questions & answers for the PCAP exam

Exam PCAP topic 1 question 40 discussion

Actual exam question from Python Institute's PCAP
Question #: 40
Topic #: 1
[All PCAP Questions]

Python's built in function named open () tries to open a file and returns:

  • A. an integer value identifying an opened file
  • B. an error code (0 means success)
  • C. a stream object
  • D. always None
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
anjuvinayan
Highly Voted 4 years, 12 months ago
answer is C :a stream object str1=open('C:/Users/avinayan/PycharmProjects/Alexa_poc/db/user_list_1.txt','rt') print(str1) Output: <_io.TextIOWrapper name='C:/Users/avinayan/PycharmProjects/Alexa_poc/db/user_list_1.txt' mode='rt' encoding='cp1252'>
upvoted 20 times
...
Pygineer
Highly Voted 4 years, 11 months ago
don't know the answer is A, C is correct answer
upvoted 5 times
...
macxsz
Most Recent 2 years, 7 months ago
Selected Answer: C
C. a stream object
upvoted 1 times
...
rocky48
2 years, 8 months ago
Selected Answer: C
The open() function returns a file object which can used to read, write and modify the file.
upvoted 1 times
...
TestPyth
2 years, 10 months ago
file= open() print (file) TypeError: open() missing required argument 'file' B
upvoted 1 times
GioGiunta
2 years, 9 months ago
wrong, you are using the function not declaring at least a file name, correct answer is C
upvoted 1 times
...
...
wprogrammer
3 years, 9 months ago
C should be the correct one
upvoted 1 times
...
FR99
4 years ago
The answer is 'C. a stream object'
upvoted 2 times
...
sacnar
4 years, 3 months ago
C should be the correct answer
upvoted 1 times
...
putriafebriana
4 years, 5 months ago
The open() function returns a file object which can used to read, write and modify the file.
upvoted 1 times
...
SophieSu
4 years, 12 months ago
Agree. CORRECT answer is C.
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...