Here you can do with a single pass, and there is not need for list
lst = []
for line in inp_dictionary:
lst.append(line.strip().split())
graphemes, phonemes = [], []
for line in lst:
if len(line)>1:
graphemes.append(list(line[0]))
phonemes.append(line[1:])
Here you can do with a single pass, and there is not need for list