Python - File Handling Fundamentals
You want to read a file and create a list of all non-empty lines without newline characters. Which code correctly does this?
line.strip() removes spaces and newline characters from both ends. The condition if line.strip() filters out empty lines.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions