Solved

You Are Attempting to Open a File Containing a List

Question 43

Multiple Choice

You are attempting to open a file containing a list of integer numbers, each on a separate line, and read them into Python as int types. What statement could you use to do this, assuming each line is represented by the line variable in a continuous loop?


A) num = int(line.strip() )
B) num = line.strip()
C) num = line.strip(int(line) )
D) num = line[:-1]

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions