← All challenges

// code challenge

Extract the log level

~10 min

Split a log line and print its severity field.

Ops logs follow a shape. Given one log line on stdin in the format:

DATE TIME LEVEL message...

print only the LEVEL (the third field).

Example input:

2026-08-12 10:31:07 ERROR db timeout after 3000ms

Expected output:

ERROR

Hint: input().split() gives you the fields; remember indexes start at 0.

Language: python · Judge0

// sample tests

  • stdin "2026-08-12 10:31:07 ERROR db timeout after 3000ms"stdout "ERROR"
  • stdin "2026-08-12 09:00:01 INFO service started"stdout "INFO"

Sign in to run and submit.

Extract the log level

⌘/Ctrl+Enter run · ⌘/Ctrl+Shift+Enter submit · Esc exits fullscreen

Run your code to see test results here.