New ! Computer Science MCQ Practise Tests



12th Standard Computer Science English Medium Python and CSV Files Reduced Syllabus Important Questions 2021

12th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 100

      Multiple Choice Questions


    15 x 1 = 15
  1. A CSV file is also known as a ….

    (a)

    Flat File

    (b)

    3D File

    (c)

    String File

    (d)

    Random File

  2. The command used to skip a row in a CSV file is

    (a)

    next()

    (b)

    skip()

    (c)

    omit()

    (d)

    bounce()

  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. What will be written inside the file test.csv using the following program
    import csv
    D = [['Exam'],['Quarterly'],['Halfyearly']]
    csv.register_dialect('M',lineterminator = '\n')
    with open('c:\pyprg\ch13\line2.csv', 'w') as f:
    wr = csv.writer(f,dialect='M')
    wr.writerows(D)
    f.close()

    (a)

    Exam Quarterly Halfyearly

    (b)

    Exam Quarterly Halfyearly

    (c)

    E, Q, H

    (d)

    Exam, Quarterly, Halfyearly

  5. Which of the following is a human readable text file where each line has fields?

    (a)

    CSV file

    (b)

    CSV module

    (c)

    CSV sheet

    (d)

    CSV text

  6. In CSV file, each record is to be located on a separate line, delimited by a line break by pressing

    (a)

    Enter key

    (b)

    ESV key

    (c)

    Tab key

    (d)

    Shift key

  7. Which of the following built-in function Python has to open a file?

    (a)

    read ()

    (b)

    open ()

    (c)

    reader ()

    (d)

    openfile ()

  8. Python function open () returns a file object called

    (a)

    read

    (b)

    write

    (c)

    handle

    (d)

    process

  9. Which python file mode open a file for exclusive creation?

    (a)

    'x'

    (b)

    'w'

    (c)

    't'

    (d)

    'a'

  10. The CSV file contents can be read with the help of the method

    (a)

    read ( )

    (b)

    open ( )

    (c)

    with open ( )

    (d)

    reader ( )

  11. The function used to add elements to CSV file is 

    (a)

    add ( )

    (b)

    write ( )

    (c)

    append ( )

    (d)

    addition ( )

  12. List literals are enclosed with

    (a)

    { }

    (b)

    ( )

    (c)

    < >

    (d)

    [ ]

  13. Which of the following works with list / tupledict?

    (a)

    read ( )

    (b)

    dictreader ( )

    (c)

    reader ( )

    (d)

    diet ( )

  14. How many ways are there to write a new or modify the existing CSV file?

    (a)

    8

    (b)

    6

    (c)

    4

    (d)

    2

  15. Which option allows to write the double quote or all the values in CSV file?

    (a)

    csv.Quote ( )

    (b)

    csv.ALL_QUOTE( )

    (c)

    csv.QUOTE_ALL ( )

    (d)

    csv.QUOTEALL ( )

    1. 2 Marks


    10 x 2 = 20
  16. What is CSV File?

  17. Mention the default modes of the File.

  18. How will you sort more than one column from a csv file?Give an example statement.

  19. Why CSV file is known as flat file?

  20. How the CSV file operation takes place in python?

  21. What take the three models in which CSV file can be opened?

  22. Differentiate text mode and binary mode.

  23. What is use of sort ( ) method?

  24. How will you read CSV file into a dictionary?

  25. What is called modification?

    1. 3 Marks


    10 x 3 = 30
  26. Write a note on open() function of python. What is the difference between the two methods?

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

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

  29. What is the difference between reader() and DictReader() function?

  30. How will you create CSV normal file?

  31. How will you save the CSV file in MS-Excel?

  32. Write the syntax of reader( ).

  33. Write a program to read a file with default delimiter comma.

  34. What are the different ways of reading a CSV file using reader ( ) method?

  35. Write a program to create a new normal CSV file to store data.

    1. 5 Marks


    7 x 5 = 35
  36. Differentiate Excel file and CSV file.

  37. Tabulate the different mode with its meaning.

  38. Write a Python program to write a CSV File with custom quotes.

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

  40. Write a program to read the CSV file through python using reader ( ) method.

  41. Write a program to read the CSV file and store it in a list.

  42. How will you write the CSV file with custom denote characters? Explain with an example.

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

Reviews & Comments about 12th Standard Computer Science English Medium Python and CSV Files Reduced Syllabus Important Questions 2021

Write your Comment