Function A&R
Function A&R
1
6. Assertion (A): - print(f1()) is a valid statement even if the function f1() has no return
statement.
Reasoning (R): - A function always returns a value even if it has no return statement.
Ans:
7. Assertion: The default value of an argument will be used inside a function if we do not
pass a value to that argument at the time of the function call.
Reason: The default arguments are optional during the function call. It overrides the
default value if we provide a value to the default arguments during function calls.
Ans:
8. Assertion (A): -Built in functions are predefined in the language that are used directly.
Reasoning(R): -print () and input () are built in functions.
Ans:
9. Assertion (A): - The default arguments can be skipped in the function call.
Reasoning (R): - The function argument will take the default values even if the values are
supplied in the function call.
Ans:
10. Assertion (A): The function definition calculate (a, b, c=1, d) will give error.
Reason (R): All the non-default arguments must precede the default arguments.
Ans:
11. Assertion (A): - To use a function from a particular module, we need to import the
module.
Reason (R): - import statement can be written anywhere in the program, before using a
function from that module.
Ans:
12. Assertion (A): Python standard library consists of number of modules.
Reason (R): A function in a module is used to simplify the code and avoids repetition.
Ans:
13. Assertion (A): For changes made to a variable defined within a function to be visible
outside the function, it should be declared as global.
Reason (R): Variables defined within a function are local to that function by default,
unless explicitly specified with the global keyword. Ans:
2
14. Assertion (A): A variable defined outside any function or any block is known as a
global variable.
Reason (R): A variable defined inside any function or a block is known as a local variable.
Ans:
15. Assertion (A): A function definition can have zero parameters/formal arguments.
Reason (R): Parenthesis are not mandatory to call a function with zero arguments.
Ans:
16. Assertion (A): Number of arguments passed to a function may not match the number
of parameters in the function definition.
Reason (R): Function parameters can have default values.
Ans:
17. Assertion (A): If the arguments in function call statement are provided in the format
parameter=argument, it is called keyword arguments.
Reason (R): During a function call, the argument list first contain keyword arguments(s)
followed by positional argument(s).
Ans:
18. Assertion (A): A function is block of organized and reusable code that is used to
perform a single, related action.
Reason (R): Function provides better modularity for your application and a high degree
of code reusability.
Ans:
19. Assertion (A): Functions in a program increases the modularity and readability of the
program.
Reason (R): Usage of functions increases the execution speed of the program.
Ans:
20. Assertion (A): Arguments are also called as actual arguments or actual parameters.
Reason (R): Parameters are also called as formal parameter or formal arguments.
Ans: