Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which of the following expressions is an example of type conversion?
Correct Answer is : 4.0 + float(3)
2. Which of the following expressions results in an error?
Correct Answer is : int(’10.8’)
3. What is the value of the expression:
4+2**5//10
Correct Answer is : 7
4. The expression 2**2**3 is evaluates as: (2**2)**3. State whether this statement is true or false.
Correct Answer is : FALSE
5. Which of these definitions correctly describes a module?
Correct Answer is : Design and implementation of specific functionality to be incorporated into a program
6. Which of the following is not an advantage of using modules?
Correct Answer is : Provides a means of reducing the size of the program
7. Program code making use of a given module is called a ______ of the module.
Correct Answer is : Client
8. ______ is a string literal denoted by triple quotes for providing the specifications of certain program elements.
Correct Answer is : Docstring
9. Which of the following is true about top-down design process?
Correct Answer is : The overall design of the program is addressed before the details
10. In top-down design every module is broken into same number of submodules? True or False?
Correct Answer is : FALSE
11. All modular designs are because of a top-down design process? True or False?
Correct Answer is : FALSE
12. What is the output of the following piece of code?
#mod1
def change(a):
b=[x*2 for x in a]
print(b)
#mod2
def change(a):
b=[x*x for x in a]
print(b)
from mod1 import change
from mod2 import change
#main
s=[1,2,3]
change(s)
Correct Answer is : There is a name clash
13. Which of the following isn’t true about main modules?
Correct Answer is : Other main modules can import main modules
14. Which of the following is not a valid namespace?
Correct Answer is : Public namespace
15. Which of the following is false about “import modulename” form of import?
Correct Answer is : The namespace of imported module becomes part of importing module
16. Which of the following is false about “from-import” form of import?
Correct Answer is : This form of import prevents name clash
17. Which of the statements about modules is false?
Correct Answer is : In the “from-import” form of import, all identifiers regardless of whether they are private or public are imported
18. What is the output of the following piece of code?
from math import factorial
print(math.factorial(5))
Correct Answer is : Error, the statement should be: print(factorial(5))
19. What is the order of namespaces in which Python looks for an identifier?
Correct Answer is : Python first searches the local namespace, then the global namespace and finally the built-in namespace
20. To include the use of functions which are present in the random library, we must use the option: