Pass Column Added
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.
Your Output
Run your code to see the output here...