QUESTION IMAGE
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\,
\)
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.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
results = open("sales.txt","r")