Python and CSV Files Book Back Questions

12th Standard EM

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 00:45:00 Hrs
Total Marks : 30
    5 x 1 = 5
  1. A CSV file is also known as a ….

    (a)

    Flat File

    (b)

    3D File

    (c)

    String File

    (d)

    Random File

  2. Which of the following is a string used to terminate lines produced by writer()method of csv module?

    (a)

    Line Terminator

    (b)

    Enter key

    (c)

    Form feed

    (d)

    Data Terminator

  3. What is the output of the following program? import csv
    d=csv.reader(open('c:\PYPRG\ch13\city.csv'))
    next(d)
    for row in d:
    print(row)
    if the file called “city.csv” contain the following details
    chennai,mylapore
    mumbai,andheri

    (a)

    chennai,mylapore

    (b)

    mumbai,andheri

    (c)

    chennai,mumba

    (d)

    chennai,mylapore 
    mumbai,andheri

  4. Which of the following creates an object which maps data to a dictionary?

    (a)

    listreader()

    (b)

    reader()

    (c)

    tuplereader()

    (d)

    DicReader ()

  5. Making some changes in the data of the existing file or adding more data is called

    (a)

    Editing

    (b)

    Appending

    (c)

    Modification

    (d)

    Alteration

  6. 3 x 2 = 6
  7. Mention the two ways to read a CSV file using Python.

  8. Mention the default modes of the File.

  9. What is use of next() function?

  10. 3 x 3 = 9
  11. Write a Python program to modify an existing file.

  12. Write a Python program to read a CSV file with default delimiter comma (,).

  13. What is the difference between the write mode and append mode

  14. 2 x 5 = 10
  15. Write a Python program to write a CSV File with custom quotes.

  16. Write the rules to be followed to format the data in a CSV file.

*****************************************

TN 12th Standard EM Computer Science free Online practice tests

Reviews & Comments about 12th Computer Science - Python and CSV Files Book Back Questions

Write your Comment