Vedansh is a Python programmer working in a school. For the Annual Sports…

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 the file is:

[St_Id, St_Name, Game_Name, Result]

Where:

St_Id → Student ID (integer)

St_Name → Student Name (string)

Game_Name → Name of the game in which the student is participating (string)

Result → Result of the game, which can be 'Won', 'Lost', or 'Tie'

To efficiently maintain the data, Vedansh wants to create the following user-defined functions:
Accept() → Accept a record from the user and add it to the file Result.csv. The column headings should also be written at the top of the CSV file.
wonCount() → Count and display the number of students who have won any event.

Write a Python program to implement the above functions.

Attempted by 46 students.

Sign up free to check your answer

Sign up free

Explore the full course: Hpsc Pgt Computer Science

Loading lesson…