KnowledgeBoat Logo

Class - 12 CBSE Computer Science — Assertion Reason Type Questions

  • Python Functions

    Assertion. If the arguments in a function call statement match the number and order of arguments as defined in the function definition, such arguments are called positional arguments.

    Reason. During a function call, the argument list first contains default argument(s) followed positional argument(s).


  • Python Functions

    Assertion (A): Function can take input values as parameters, execute them and return output (if required) to the calling function with a return statement.

    Reasoning (R): A function in Python can return multiple values.

    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 Functions

    Assertion (A): If the arguments in a function call statement match the number and order of arguments as defined in the function definition, such arguments are called positional arguments.

    Reasoning (R): During a function call, the argument list first contains default argument(s) followed by positional argument(s).

    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 Functions

    Assertion (A): Local Variables are accessible only within a function or block in which they are declared.

    Reasoning (R): Global variables are accessible in the whole 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.


  • Python Functions

    Assertion (A): The local and global variables declared with the same name in the function are treated in the same manner by the Python interpreter.

    Reasoning (R): The variable declared within the function block is treated as local, whereas the variable declared outside the function block will be referred to as a global variable.

    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 Functions

    Assertion (A): The functions developed and defined by language programmers and provided within the framework of the language are termed as built-in functions.

    Reasoning (R): Each and every built-in function contains a set of statements to perform a specific task. They are independent entities and, hence, not included within any module or object.

    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 Functions

    Assertion (A): To use positional arguments, the arguments need to be passed in the same order as their respective parameters in the function definition.

    Reasoning (R): If three positional arguments are to be passed to the function, the first argument will be assigned to the first parameter, second argument to the second parameter and the third argument to the third parameter.

    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 Functions

    Assertion (A): Positional arguments in Python functions must be passed in the exact order in which they are defined in the function signature.

    Reasoning (R): This is because Python functions automatically assign default values to positional arguments.

    1. Both A and R are true, and R is the correct explanation of A.
    2. Both A and R are true, and 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 Libraries

    Assertion. The documentation for a Python module should be written in triple-quoted strings.

    Reason. The docstrings are triple-quoted strings in Python that are displayed as documentation when help <module> command is issued.


  • Python Libraries

    Assertion. After importing a module through import statement, all its function definitions, variables, constants etc. are made available in the program.

    Reason. Imported module's definitions do not become part of the program's namespace if imported through an import <module> statement.


Showing 31 - 40 of 201 Questions