IMP Python Mcqs G
IMP Python Mcqs G
Answer: d) 5.0
Answer: d
Explanation: The function seed is a function which is present in the random
module. The functions sqrt and factorial are a part of the math module. The
print function is a built-in function which prints a value directly to the system
output.
b)
x is 50
Changed local x to 2
x is now 2
c)
x is 50
Changed local x to 2
x is now 100
3] If return statement is not used inside the function, the function will return :
a. None
b. 0
c. Null
d. Arbitary value
Answer: a
2] Which library offers many functions and tools to produce quality output in
variety of formats such as plot, Charts,Graph etc.
a) Numpy Library
b) Scipy ibra Library
c) Thinter Library
d) Malplotlib library
Answer- d)
Answer: b) Constructor
1)The _________ module in the Python library provides the infrastructure for
defining custom abstract base classes.
1)math
2) abstractclass
3) abc
4) @abstractmethod
Ans:3)abc
2) _______ metaclass for defining the abstract class and _______ helper class ,
we can use it in the area where we want to avoid the confusion of metaclass
usage.
1)ABC , ABCMeta
2)ABCMeta , ABC
3) abstractclass , ABC
4) ABCMeta , abstractmethod
Ans : 2)ABCMeta , ABC
Explanation: If the class definition is class B(A): then class B inherits the
methods of class A. This is called inheritance.
Answer: c
Explanation: Any changes made to the private members of the class in the
subclass aren’t reflected in the original members.
Answer: d
Answer: c) [A]
The c conversion type supports character conversion from ASCII code to
the character. It also works for the Unicode
A). 15 15
B). F F
C). ff
D). f F
Ans: D) f F
Ans: c.writelines()
Ans: a. True
1. Which mode create new file if the file does not exist?
a. write mode
b. append mode
c. Both of the above
d. None of the above
temp = tester(12)
print(temp.id)
a) 1 2
b) 224
c)None
d) Error
try:
print(x)
except:
print(""An
exception
occurred"")
a. X
b. An exception occurred
c. Syntax Error
d. None of the above