Python Morsels: Why splitlines() instead of split("\n")? To split text into lines in Python, use thesplitlines()method,notthesplit()method. Read the full article: https://www.pythonmorsels.com/splitlines/ https://www.pythonmorsels.com/splitlines/