Question: What data type does the following function return? def read _ text ( filename ) : def read _ text ( filename ) : words

What data type does the following function return?
def
read_text(filename):
def read_text(filename):
words
=
[]
words =[]
with
open(filename,
"r")
as
infile:
with open(filename,"r") as infile:
for
line
in
infile:
for line in infile:
words
+=
line.split()
words += line.split()
return
words
return words
Choice 1 of 4:a 2D list
Choice 2 of 4:a dictionary
Choice 3 of 4:a 1D list
Choice 4 of 4:a string

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!