MCQs
On assigning a value to a variable inside a function, t automatically becomes a local variable. Hence the above statement is false.
The speed of a program using recursion is slower than the speed of its non-recursive equivalent.
The code shown above shows a nested list. A nested list will undergo shallow copy when the list as a whole undergoes deep copy. Hence the output of this code is False.
If a local variable exists with the same name as the local variable that you want to access, then the global variable is shadowed. That is, preference is given to the local variable.
getopt parses options received from the command line.
It is a list of elements.
zero keyword arguments may be passed if all the arguments have default values.
The variable x is a local variable. It is first printed and then modified. Hence the output of this code is 100.