read file line by line into list

61

read file line by line into list -

with open("file.txt") as file:
    lines = file.readlines()
    lines = [line.rstrip() for line in lines]

Comments

Submit
0 Comments