iGET

Python Programming - MCQ Practice Questions

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

119 questions | 100% Free

Q.41Medium

Consider: a = 'Hello'; b = 'Hello'. Are a and b the same object?

Q.42Medium

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

Q.43Medium

Consider: x = [1, 2, 3, 4, 5]; y = x[1:4]. What is y?

Q.44Medium

Consider: d = {'a': 1, 'b': 2}; d['c'] = 3. What is d?

Q.45Medium

Consider the code: x = (1, 2, 3); x[0] = 5. What happens?

Q.46Medium

What is the output of: print(None == False)?

Q.47Medium

Consider the following code snippet: python x = [1, 2, 3] y = x y.append(4) print(x) What will be the output?

Q.48Medium

What is the output of: len([1, [2, 3], 4, [5, [6, 7]]])?

Q.49Medium

Which statement correctly creates a list of numbers from 1 to 5?

Q.50Medium

What will be printed? my_list = [10, 20, 30] my_list[1] = 25 print(my_list)

Q.51Medium

Which of the following will return True? my_list = [1, 2, 3] result = 2 in my_list

Q.52Medium

What is the difference between list and tuple in Python?

Q.53Medium

What will be the output? my_list = [1, 2, 3] my_list.extend([4, 5]) print(my_list)

Q.54Medium

How many times will the value 2 appear in the output? my_list = [1, 2, 2, 3, 2, 4] print(my_list.count(2))

Q.55Medium

What will be the output? my_list = [[1, 2], [3, 4], [5, 6]] print(my_list[1][0])

Q.56Medium

What will this code produce? my_list = [3, 1, 4, 1, 5] my_list.sort() print(my_list)