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

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

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 (?) , you can switch to a simple comment.
Switch to a voting comment New
anjuvinayan
Highly Voted 4 years, 4 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, 4 months ago
don't know the answer is A, C is correct answer
upvoted 5 times
...
macxsz
Most Recent 1 year, 11 months ago
Selected Answer: C
C. a stream object
upvoted 1 times
...
rocky48
2 years, 1 month 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, 2 months ago
file= open() print (file) TypeError: open() missing required argument 'file' B
upvoted 1 times
GioGiunta
2 years, 2 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, 2 months ago
C should be the correct one
upvoted 1 times
...
FR99
3 years, 5 months ago
The answer is 'C. a stream object'
upvoted 2 times
...
sacnar
3 years, 8 months ago
C should be the correct answer
upvoted 1 times
...
putriafebriana
3 years, 10 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, 4 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 ...