Exam PCAP All QuestionsBrowse all questions from this exam
Question 40

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

    Correct Answer: C

    The open() function in Python is used to open a file and it returns a file object. This file object can be used to read, write, and modify the file. It serves as a stream object that connects the program with the file on disk, allowing for file operations to be performed.

Discussion
anjuvinayanOption: C

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'>

PygineerOption: C

don't know the answer is A, C is correct answer

SophieSuOption: C

Agree. CORRECT answer is C.

FR99Option: C

The answer is 'C. a stream object'

macxszOption: C

C. a stream object

rocky48Option: C

The open() function returns a file object which can used to read, write and modify the file.

TestPythOption: B

file= open() print (file) TypeError: open() missing required argument 'file' B

GioGiunta

wrong, you are using the function not declaring at least a file name, correct answer is C

wprogrammerOption: C

C should be the correct one

sacnarOption: C

C should be the correct answer

putriafebrianaOption: C

The open() function returns a file object which can used to read, write and modify the file.