KnowledgeBoat Logo

Class - 12 CBSE Computer Science — Assertion Reason Type Questions

  • Python File Handling

    Assertion. CSV (Comma Separated Values) is a file format for data storage which looks like a text file.

    Reason. The information is organized with one record on each line and each field is separated by comma.


  • Python Data Handling

    Assertion (A): The file in Python is used to store information on a named location in the secondary storage device.

    Reasoning (R): In Python, files are classified as program files and data files and as per the file type store the data specific to its use and purpose.

    1. Both A and R are true and R is the correct explanation of A.
    2. Both A and R are true but R is not the correct explanation of A.
    3. A is true but R is false.
    4. A is false but R is true.


  • Python Data Handling

    Assertion (A): The file access mode used to add or append the data in the file is 'a'.

    Reasoning (R): In the access mode, 'a', the text will be appended at the end of the existing file. If the file does not exist, Python will create a new file and write data to it.

    1. Both A and R are true and R is the correct explanation of A.
    2. Both A and R are true but R is not the correct explanation of A.
    3. A is true but R is false.
    4. A is false but R is true.


  • Python Data Handling

    Assertion (A): The binary files are an advanced version of text files and work similar to text files.

    Reasoning (R): The data in binary files are stored in the form of binary digits, 0 and 1; and is directly understood by the computer.

    1. Both A and R are true and R is the correct explanation of A.
    2. Both A and R are true but R is not the correct explanation of A.
    3. A is true but R is false.
    4. A is false but R is true.


  • Python Data Handling

    Assertion (A): To work with binary files, we need to import pickle module.

    Reasoning (R): Pickle module contains two important methods for reading and writing data to binary files, i.e., load() and dump() respectively.

    1. Both A and R are true and R is the correct explanation of A.
    2. Both A and R are true but R is not the correct explanation of A.
    3. A is true but R is false.
    4. A is false but R is true.


  • Python Data Handling

    Assertion (A): The close() method is used to close the file.

    Reasoning (R): While closing a file, the system frees up all the resources like CPU processor time and memory allocated to it.

    1. Both A and R are true and R is the correct explanation of A.
    2. Both A and R are true but R is not the correct explanation of A.
    3. A is true but R is false.
    4. A is false but R is true.


  • Python Data Handling

    Assertion (A): The readline() method reads one complete line from a text file.

    Reasoning (R): The readline() function can also be used to read a specified number (n) of bytes of data from a file but maximum up to the newline character (\n).

    1. Both A and R are true and R is the correct explanation of A.
    2. Both A and R are true but R is not the correct explanation of A.
    3. A is true but R is false.
    4. A is false but R is true.


  • Python Data Handling

    Assertion (A): CSV stands for Comma Separated Values.

    Reasoning (R): CSV files are common file format for transferring and storing data.

    1. Both A and R are true and R is the correct explanation of A.
    2. Both A and R are true but R is not the correct explanation of A.
    3. A is true but R is false.
    4. A is false but R is true.


  • Python Data Handling

    Assertion (A): Text file stores information in the ASCII or Unicode format/characters.

    Reasoning (R): In a text file, there is no delimiter for a line.

    1. Both A and R are true and R is the correct explanation of A.
    2. Both A and R are true but R is not the correct explanation of A.
    3. A is true but R is false.
    4. A is false but R is true.


  • Python Exception Handling

    Assertion (A): Exception handling handles all types of errors and exceptions.

    Reasoning (R): Exception handling is responsible for handling anomalous situations during the execution of a program.

    1. Both A and R are true and R is the correct explanation of A.
    2. Both A and R are true but R is not the correct explanation of A.
    3. A is true but R is false.
    4. A is false but R is true.


Showing 51 - 60 of 201 Questions