Correct Answer: [[2], [2], [2], [2]]
Explanation:
Note: This Question is unanswered, help us to find answer for this one
Python Skill Assessment
Your Skill Level: Poor
Retake Quizzes to improve it
More Python MCQ Questions
What is a persistent dictionary?
After you enter the following in a Python script and run the script, what would get printed? formatter = '%s' print formatter % (formatter)
What does a function glob.glob do?
In order to display a value in the interactive interpreter, Python uses what method of a class?
Given str='code', what will be the result of the expression str[0] = 'm'?
Output of the following Python code? def ps(a,b): s = a + b return (s, a) s, a = ps(0,4) a=a+4 s1 = 1 i = 1 while i <= a: s1 = s1 + i i = i+1 print(s1)
Output of the following Python code? class Son(object): def __init__(self, n): self.n = n def gN(self): return self.n def sE(self): return False class Ploy(Son): def __init__(self, n, eid): super(Ploy, self).__init__(n) self.empID = eid def sE(self): return True def gID(self): return self.empID emp = Ploy("1", "0") print(emp.gN(), emp.sE(), emp.gID())
This question is based on the graphic shown below. What will be the output of the given Python code?
Output of the following Python code? class Error(Exception): ''0...' pass class ValueTooSmallError(Error): '.'1uu' pass class ValueTooLargeError(Error): m2'... pass number = 10 while True: try: i_num =10 if i_num < number: raise ValueTooSmallError elif i_num > number: raise ValueTooLargeError break except ValueTooSmallError: print('1') printi) except ValueTooLargeError: print('1') printi) print('0')
Correct answer from the given options. class ErrorInCode(Exception): def __init__(self, data): self.data = data def __str__(self): return repr(self.data) try: raise ErrorInCode(1000) except ErrorInCode as ae: print ('0'ae.data) finally: print ('1')