Quoted CSV Record Field Splitter & Schema Validator

Difficulty: Easy · Unit 4: Files, Exceptions & Standard Library · Featured in: CodeTantra Lab Pattern

Given N CSV rows with columns `name,score`, where `name` may contain commas inside double quotes (e.g. `"Doe, Jane",95`), compute the highest-scoring student's name (first seen on tie) among rows whose score is an integer between 0 and 100 inclusive. If no valid rows exist, print `NONE`.

Input & Output Format

Input: Line 1: integer N. Next N lines: CSV rows.

Output: Print `<name> <score>` of the top valid student, or `NONE`.

Sample 1

3
"Sharma, Aarav",88
Riya,105
Kabir,94
Kabir 94

Riya has score 105 (out of 0..100) and is skipped; Kabir beats Aarav (94 > 88).

Free forever — sign in with email at poorvithmp.com to unlock the dry run, verified Python 3 solution, edge-case traps, and downloads.

Back to Python Notes Hub