apple
mango
banana
tea
coffee
Can someone please suggest a python code to remove the empty rows in this case after banana/tea/coffee so the actual result should be as below without any empty rows in between and after the end of lists
apple
mango
banana
tea
coffee
i have forgot to check the spaces after last string in the file. After i remove the spaces and bringing the curser just in parallel to the last string, this solves the problem. thanks all.