Python Programming - MCQ Practice Questions
Core Python MCQs — syntax, data types, OOP, libraries for placements & IT exams.
119 questions | 100% Free
What will be the output of: print(type(3.14))
What is the output of: x = '25'; y = int(x); print(y + 5)
What will be the output of: lst = [1, 2, 3]; lst.extend([4, 5]); print(lst)
Consider the code: x = [10, 20, 30]; y = x; y[0] = 99; print(x[0]). What is the output?
What will be the output of: print(bool(0), bool(''), bool([]))
Which operator in Python performs integer division?
What is the output of: for i in range(3): print(i, end=' ')
Consider: s = 'Python'; print(s[2:5]). What will be the output?
What will be the output of: x = 10; y = 20; x, y = y, x; print(x, y)
Which of the following will raise a TypeError in Python?
What will be the output of: d = {'a': 1, 'b': 2}; print(list(d.items()))
Consider: x = [i**2 for i in range(4)]. What is x?
What will be the output of: print(any([False, False, True]))
In Python, which of the following is an immutable data type?
What will be the result of executing: print(type(5.0))?
What does the len() function return when applied to a string 'India'?
Consider the code: num = '123'. What will int(num) return?
Which of the following is the correct syntax for a Python comment?
What is the output of: print('Hello' + ' ' + 'World')?
Which method is used to add an element to a list in Python?