Computer Fundamentals for Placements – Python MCQs with Answers
Q. 1 What is the output of print(type([]))?
Check Solution
Ans: A
[] represents an empty list in Python.
Q. 2 Which keyword is used to define a function in Python?
Check Solution
Ans: C
Functions in Python are defined using the ‘def’ keyword.
Q. 3 What is the default return value of a function that does not explicitly return anything?
Check Solution
Ans: B
If no return statement is specified, Python functions return None by default.
Q. 4 Which of the following is immutable in Python?
Check Solution
Ans: D
Tuples are immutable, while lists, sets, and dictionaries are mutable.
Q. 5 What will be the output of print(2 ** 3 ** 2)?
Check Solution
Ans: B
Exponentiation is right-associative in Python, so 3**2=9, then 2**9=512.
Q. 6 Which of the following is the correct way to open a file for reading in Python?
Check Solution
Ans: A
‘r’ mode opens the file for reading. ‘w’ for writing, ‘a’ for append.
Q. 7 What is the output of print(bool(“”))?
Check Solution
Ans: B
An empty string evaluates to False in boolean context.
Q. 8 Which built-in function is used to get the length of a list?
Check Solution
Ans: C
len() is the correct built-in function to get the length of an object.
Q. 9 What will be the output of print([i for i in range(5) if i%2==0])?
Check Solution
Ans: B
The list comprehension selects even numbers from 0–4 → [0,2,4].
Q. 10 Which of these data types is not built-in in Python?
Check Solution
Ans: C
Array is not a built-in data type; it’s provided via external modules like ‘array’.
Next Topic: SQL MCQs for Placement Tests
Practice Aptitude Questions for Placements
Crack Placement Tests: Faster & Smarter
Adaptive Practice | Real Time Insights | Resume your Progress
