Python MCQ with Answers
Updated: Nov 15, 2022
1. What is the output of the below program in python:
print(0.2+0.4==0.6)
A. True
B. False
C. Error
D. Depends on machine
Answer: B: False due to not compare floating point value
2. Which is not a feature of Python language?
A. Interpreted language
B. Portable
C. High level language
D. Case Insensitive
Answer: D: Case Insensitive
3. Python is a ………….object-oriented programming language.
A. Special purpose
B. General purpose
C. Medium level programming language
D. All of the mentioned above
Answer: B: General purpose
4. Developer of Python programming?
A. Denis Ritchie
B. Y.C. Khenderakar
C. Tim Berner Lee
D. Guido van Rossum
Answer: D: Guido van Rossum
5. What is the output in python language?
Round (.4)-Round (-.5)
A. 0
B. 1
C. 2
D. .9
Answer: B: 1
6. Which are the application areas of Python programming?
A. Web Development
B. Game Development
C. Artificial Intelligence and Machine Learning
D. All of the above
Answer: D: All of the above
7. What is Numeric Types of Data Types?
A. int
B. float
C. complex
D. All of the above
Answer: D: All of the above
8. What is output in python?
A. print(r"\nhi")
B. hi
C. new line and hi
D. error
E. \nhi
Answer: D: \nhi
9. What is output for below code?
a=2
b=3
print(a,b)
a,b=b,a
print(a,b)
A. 23 23
B. 23 32
C. 32 32
D. None of Above
Answer: B
10. list, tuple dictionary are which types of Data Types.
A. Binary Types
B. Boolean Types
C. Sequence Types
D. None of the above
Answer: C: Sequence Types
11. Which types of logical operators in Python?
A. AND
B. OR
C. NOT
D. All of the above
Answer: D: All of the above
12. What is the name of the operator ** in Python?
A. Exponentiation
B. Modulus
C. Floor division
D. None of the these
Answer: A: Exponentiation
13. What is the output of following code?
x="Ram, Shya"
print(x[::5]
A. RS
B. RAMSH
C. RAM
D. SHYAM
Answer: A: RS
14. What is the extension of Python Program?
A. .execute python
B. .python
C. .py
D. .run python
Answer: C: .py
15. Which keyword used in python language?
A. finally
B. lambda
C. while
D. All of Above
Answer: D: All of Above
16. Which return the % operator?
A. Quotient
B. Divisor
C. Remainder
D. Multiplication
Answer: C: Remainder
17. What is the maximum possible length of an identifier?
A. 31 characters
B. 63 characters
C. 79 characters
D. 69 characters
Answer: C: 79 characters
18. Which are methods of list?
A. append()
B. extend()
C. insert()
D. All of the above
Answer: D: All of the above
19. The list.pop ([i]) is used for removing the item at the given position in the list?
A. Yes
B. No
Answer: A: Yes
20. What is the output of following program?
r = lambda q: q * 2
s = lambda q: q * 3
x = 2
x = r(x)
x = s(x)
x = r(x)
print (x)
A. 4
B. 12
C. 24
D. None of Above
Answer: C: 24
21. What is the output of following program?
a = 4.5
b = 3
print (a//b)
A. 1.0
B. 2.0
C. 0
D. None of Above
Answer: A: 1.0
22. What is the output of following program?
a = True
b = False
c = False
if a or b and c:
print ("CAREERBODHSANSTHAN")
else:
print ("careerbodh")
A. CAREERBODHSANSTHAN