Find the output of the following Python code. Assume the file students.csv…

NVS TGT/PGT 2026

Find the output of the following Python code. Assume the file students.csv contains the following data :

Roll,Name,Score
1,Amit,85
2,Sumit,92
import csv

def AnalyzeCSV():
    with open('students.csv', 'r') as F:
        Reader = csv.DictReader(F)
        R1 = next(Reader)
        # Accessing data
        V1 = R1[0]; V2 = R1[2]
        # Checking types and headers
        print(V1)
        print(type(V2).__name__)
        print(reader.fieldnames[0])
        print(len(R1))

AnalyzeCSV()

Sign up free to check your answer

Sign up free

Explore the full course: Hpsc Pgt Computer Science

Loading lesson…