Computer Science - Class 12
Solutions to CBSE Sample Paper - Computer Science Class 12

Vedansh is a Python programmer working in a school. For the Annual Sports Event, he has created a csv file named Result.csv, to store the results of students in different sports events. The structure of Result.csv is :

[St_Id, St_Name, Game_Name, Result]


St_Id is Student ID (integer)

ST_name is Student Name (string)

Game_Name is name of game in which student is participating(string)

Result is result of the game whose value can be either 'Won', 'Lost' or 'Tie'

For efficiently maintaining data of the event, Vedansh wants to write the following user defined functions:

Accept() – to accept a record from the user and add it to the file Result.csv. The column headings should also be added on top of the csv file.

wonCount() – to count the number of students who have won any event.

As a Python expert, help him complete the task.


Answer by student

Python Program to accept a record of a student from the user and add it to a csv file and to count the number of students who have won any event - Teachoo.png

Detailed answer by teachoo

The rest of the post is locked. Join Teachoo Black to see the full post.

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.