← Questions

Validate fixed-field records from a message file

0
StripeCodingLast asked Jan 2026

Read a file of messages, one record per line. Each line starts with a timestamp, followed by the record's fields; a valid record has exactly five fields after the timestamp, none of them empty once trimmed, the first being a name. Strip the timestamp, validate every line and report which records are valid, in order. Be careful with blank fields, extra or missing separators and stray whitespace.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding