split(maxsplit=3) — what does it do?

JackStackOP

Why not just split()?

2

Comments 4

Join the discussion

Already have an account? Log in

  1. TomBeckerreplies: 2

    The message part contains spaces ("Fuel valve 2 not responding"). With maxsplit=3, Python splits only the first three times, so you get exactly four parts: time, level, subsystem, and the whole message.

    5
      1. LucasVD

        This is the robust version of "Count warnings". Love seeing the progression.

        3
    1. EmmaCodes

      Counting by hour: take the hour from the time string with a slice. Two Counters, one loop.

      1