The newlines that readlines() keeps
Predict the output · Medium · §9.3 Reading a file
members.txt already exists with the content below. Predict the output without running the code.
Code
f = open("members.txt", "r")
names = f.readlines()
f.close()
print(len(names))
print("jun" in names)
print(names[1].strip() == "jun")File members.txt
mina
jun
soraSolve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.