11 Python Interview Questions 1
11 Python Interview Questions 1
Page 2 of 11
iNeuron Intelligence Pvt Ltd
A. new
B. except
C. class
D. object
Ans: C
Page 3 of 11
iNeuron Intelligence Pvt Ltd
A. __init__
B. __init__()
C. init
D. init()
Ans: B
A. __init__()
B. self
C. both A and B
D. None of the above
Ans: B
A. delete
B. dedl
Page 4 of 11
iNeuron Intelligence Pvt Ltd
C. del
D. drop
Ans: C
A. Inheritance
B. Instance variable
C. FuncRon overloading
D. InstanRaRon
Ans: B
A. Class variable
B. Method
C. Operator overloading
D. Data member
Page 5 of 11
iNeuron Intelligence Pvt Ltd
Ans: D
A. To set an acribute
B. To access the acribute of the object
C. To check if an acribute exists or not
D. To delete an acribute
Ans: A
class test:
def __init__(self,a):
self.a=a
def display(self):
print(self.a)
obj= test ()
obj. display ()
Page 6 of 11
iNeuron Intelligence Pvt Ltd
Ans: C
ExplanaRon: Since, the __init__ special method has another
argument a other than self, during object creaRon, one argument is
required. For example: obj=test(“Hello”)
13. ___ represents an enRty in the real world with its idenRty and
behaviour.
A. A method
B. An object
C. A class
D. An operator
View Answer
Ans- B
Page 7 of 11
iNeuron Intelligence Pvt Ltd
A. Objects are real world enRRes while classes are not real.
B. Classes are real world enRRes while objects are not real.
C. Both objects and classes are real world enRRes.
D. Both object and classes are not real.
Ans: A
A. acribute
B. object
C. argument
D. funcRon
Ans: D
Ans: B
dict1={"a":10,"b":2,"c":3}
str1=""
for i in dict1:
str1=str1+str(dict1[i])+" "
str2=str1[:-1]
print(str2[::-1])
A. 3, 2
B. 3, 2, 10
C. 3, 2, 01
D. Error
Ans: C
Page 9 of 11
iNeuron Intelligence Pvt Ltd
Page 10 of 11
iNeuron Intelligence Pvt Ltd
Page 11 of 11