iGET

Python Programming - MCQ Practice Questions

Core Python MCQs — syntax, data types, OOP, libraries for placements & IT exams.

119 questions | 100% Free

Q.61Easy

What will be the output of: print(10 // 3)?

Q.62Medium

Consider: s = 'Python'. What is s[-1]?

Q.63Medium

Which of the following will correctly check if a key exists in a dictionary?

Q.64Medium

Consider the code: def func(a, b=5): return a + b. What is func(3)?

Q.65Medium

What will be printed: for i in range(1, 4): print(i, end=' ')?

Q.66Medium

Consider: lst = [1, 2, 3, 2, 1]. What will lst.count(2) return?

Q.67Medium

What is the output of: print(5 == '5')?

Q.68Medium

Consider the code: x = 5; y = x; x = 10. What is the value of y?

Q.69Medium

What will be the output of: print(isinstance(5, int))?

Q.70Medium

Consider: result = [x*2 for x in range(3) if x > 0]. What is result?

Q.71Medium

What will be the result of: ' hello '.strip()?

Q.72Medium

Consider: d = {1: 'a', 2: 'b', 3: 'c'}. What is d.get(4, 'default')?

Q.73Medium

Consider: lst = [1, [2, 3], 4]. What is lst[1][0]?

Q.74Medium

What will be the output of: print('abc' * 3)?

Q.75Hard

Consider: try: int('abc'); except: print('error'). What will be printed?

Q.76Hard

What is the output of: print(*[1, 2, 3])?

Q.77Hard

Consider: f = lambda x: x**2. What is f(5)?

Q.78Hard

What will be the result of: set([1, 2, 2, 3, 3, 3])?

Q.79Hard

Consider: *a, b = [1, 2, 3]. What is a?

Q.80Hard

What is the output of: print(eval('2+3*4'))?