CJCoding With Joseph
15free / daySign inCreate account

Pass Column Added

Input: the first line is a whole number n, then n lines each holding a name and a whole-number score separated by a comma (for example Maya,72); no prompts. Write marks.csv with the header name,score followed by the n input lines exactly as read (a for over range(n) reads them with input()). Read it back with csv.DictReader, collecting the rows in a list with append, then write results.csv with csv.DictWriter (open it with newline=""), field names name, score and passed, a header row from writeheader, and one row per student where passed is yes when the score is 50 or more and no otherwise. Finally read results.csv as plain text with f.read() and print it with end="", then print <p> passed, <q> failed with the two counts. Import only csv.

Expected Output:

name,score,passed
Maya,72,yes
Omar,45,no
Lee,50,yes
2 passed, 1 failed

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
FilesCSV
📥 Auto-Input:
3\nMaya,72\nOmar,45\nLee,50\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.