Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

your program analyzes complex data. you are going to read text from a f…

Question

your program analyzes complex data. you are going to read text from a file as part of your program. the program is saved in a folder, which has a subfolder called
umbers.\ in the info folder is a text file called \sales.txt.\ which line of code will open sales.txt? results.open(\sales.txt\,\w\) results = open(\sales.txt\,
\) results = open(
umbers/sales.txt\,\w\) results = open(
umbers/sales.txt\,
\)

Explanation:

Brief Explanations

The open() function in Python is used to open files. The first argument is the file path (relative or absolute). Here the file "sales.txt" is in the "info" folder which is not "numbers" as wrongly indicated in some options. Also, since we are reading text from the file, the mode should be "r" (read - mode). The correct syntax is to assign the result of the open() function to a variable.

Answer:

results = open("sales.txt","r")