I have a txt file that contains names which are separated by lines but with some empty lines. When I execute the following code, every second name gets ommitted in the output array. Why is that?
def get_string_list(string_textfile):
list = []
file = open("names.txt", "r")
for line in file:
line = file.readline()[:-1]
list.append(line.lower())
return list