| 1. |
Why are local variable names beginning with an underscore discouraged?
|
||||||||
|
Answer:
Option (a) |
| 2. |
Which of the following is not a keyword?
|
||||||||
|
Answer:
Option (a) |
| 3. |
All keywords in Python are in _________
|
||||||||
|
Answer:
Option (d) |
| 4. |
Given a function that does not return any value, What value is thrown by default when executed in shell.
|
||||||||
|
Answer:
Option (d) |
| 5. |
What is the return type of function id?
|
||||||||
|
Answer:
Option (a) |
| 6. |
To find the decimal value of 1111, that is 15, we can use the function
|
||||||||
|
Answer:
Option (d) |
| 7. |
In the following Python code, which function is the decorator?
def mk(x):
def mk1():
print(""Decorated"")
x()
return mk1
def mk2():
print(""Ordinary"")
p = mk(mk2)
p()
|
||||||||
|
Answer:
Option (b) |
| 8. |
The ______ symbol along with the name of the decorator function can be placed above the definition of the function to be decorated works as an alternate way for decorating a function.
|
||||||||
|
Answer:
Option (c) |
| 9. |
What will be the output of the following Python function?
def f(p, q):
return p%q
f(0, 2)
f(2, 0)
|
||||||||
|
Answer:
Option (c) |
| 10. |
A function with parameters cannot be decorated.
|
||||
|
Answer:
Option (a) |