PYTHON
QUESTION 3 MULTIPLE CHOICE
years = []
with open("years.txt") as file:
for line in file:
line = line.replace("\n", "")
years.append(int(line)) # converts str to int
print(years)
A. Refer to the code above, what does the program do?
a.
Reading the items in a list from a file with \n
c.
Reading the lines in a file from a list
b.
How to read file into a list and print in lines
d.
Reading the items in a list from a file
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here