splitlines() vs split("\n")

AmeliaRunsOP

Any difference?

5

Comments 4

Log in to join the discussion.

Log in Create account
  1. OliviaPyreplies: 1

    splitlines() handles all line endings (\n, \r\n from Windows files, etc.) and doesn't give you an empty string at the end if the text ends with a newline. Safer for real data.

    2
    1. AmeliaRunsOP

      Windows line endings, good point.

      0
    2. LiamByte

      timestamp[11:19] in stage 2 — same slicing as in "Date and time from a timestamp". The challenges build on each other nicely.

      1
      1. LucasVD

        This is where it starts feeling like real data processing.

        1