Is the bug report complete?

Maintainers ask for the same facts in every bug report. Check a report for them.

What to build

A program that checks a bug report for five required fields.

Requirements

  • The fields, in this order, are Title, Steps, Expected, Actual and Version.
  • A field is present if some line, after removing spaces at both ends, starts with the field name, a colon, and then some text that is not blank.
  • Print OK NAME or MISSING NAME for each field.
  • Finally print READY if nothing is missing, otherwise NEEDS INFO (K missing).

Input

The first line has n (1 to 50). The next n lines are the report.

Output

Five field lines and the final line.

Constraints

1 ≤ n ≤ 50. Field names are case-sensitive.

Example

Input:

5
Title: average() crashes on an empty list
Steps: call average([])
Expected: 0
Actual: ZeroDivisionError
Version: mylib 2.1.0

Output:

OK Title
OK Steps
OK Expected
OK Actual
OK Version
READY

Why it works

Each field is an independent test on the lines, so the answer is five yes or no checks; requiring text after the colon catches the common case of a heading left empty.

Examples

Example 1 · Input
5
Title: average() crashes on an empty list
Steps: call average([])
Expected: 0
Actual: ZeroDivisionError
Version: mylib 2.1.0
Expected output
OK Title
OK Steps
OK Expected
OK Actual
OK Version
READY
Example 2 · Input
3
Title: It does not work
Steps:
Actual: crash
Expected output
OK Title
MISSING Steps
MISSING Expected
OK Actual
MISSING Version
NEEDS INFO (3 missing)

Prompts inside input() are ignored when checking, so input("n: ") is fine.

Hints

Hint 1

For each field, look for a stripped line that starts with the field name and a colon.

Hint 2

The report is missing the field if the text after the colon is empty.

Hint 3

Print the five results in the given order.

Solution

Show one correct solution (try it yourself first)
FIELDS = ["Title", "Steps", "Expected", "Actual", "Version"]
n = int(input())
lines = [input().strip() for _ in range(n)]
missing = 0
for name in FIELDS:
    present = any(line.startswith(name + ":") and line[len(name) + 1:].strip() for line in lines)
    if present:
        print("OK", name)
    else:
        print("MISSING", name)
        missing += 1
print("READY" if missing == 0 else f"NEEDS INFO ({missing} missing)")

▶ Open this solution in the compiler, then press Visualize to watch it run step by step

Lesson: Issues and bug reports →