Python MCQ Questions Set-3

python-mcq
Q1: What is the output of the following code − a = (1, 2) a[0] +=1 a)(1,1,2) b)2 c)Type Error d)Syntax Error Answer: C Q2: Suppose we have two sets A & B, then A<B is: a)True if len(A) is less than len(B). b)True if A is a proper subset of B. c)True if the elements in A when compared are less than the elements in B. d)True if A is a proper superset of B. Answer : B Q3: Select the reserved keyword in python a) else b) import c) raise d) All of these Ans: D Q4...
Read More

Python MCQ Questions Set-2

python-mcq
Python MCQ Questions:- Q1. What is the output of the following code? print(type(type())) a)Error b)Null c)None d)None of the above Answer a Q2.What is the output of following code? print(type(type)) a) <class 'type'> b)Error c) <class 'none'> d)None of the above Answer a Q3. What is the output of following code? class cc: def f1(self,a,b): self.a=a self.b=b return self.a+self.b o=new cc() print(o.f1(4,4)) a)8 b)Error c)4 d)None...
Read More

Python MCQ Questions Set-1

python-mcq
This Python MCQ Questions and Answers are based on important and latest topics of Python programming. Q1: What will be the output of the following Python code? class A(): def disp(self): print("A disp()") class B(A): pass obj = B() obj.disp() a) Invalid syntax for inheritance b) Error because when object is created, argument must be passed c) Nothing is printed d) A disp() Answer: d Q2: What will be the output of the following Python code? class Test: de...
Read More