PCAP Exam QuestionsBrowse all questions from this exam

PCAP Exam - Question 40


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

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

10 comments
Sign in to comment
anjuvinayanOption: C
Nov 29, 2019

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
Dec 5, 2019

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

SophieSuOption: C
Dec 3, 2019

Agree. CORRECT answer is C.

FR99Option: C
Nov 1, 2020

The answer is 'C. a stream object'

putriafebrianaOption: C
Jun 8, 2020

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

sacnarOption: C
Aug 8, 2020

C should be the correct answer

wprogrammerOption: C
Feb 5, 2021

C should be the correct one

TestPythOption: B
Jan 23, 2022

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

GioGiunta
Feb 4, 2022

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

rocky48Option: C
Mar 8, 2022

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

macxszOption: C
May 3, 2022

C. a stream object