iGET

Python Programming - MCQ Practice Questions

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

119 questions | 100% Free

Q.1Easy

What will be the output of the following code? my_list = [1, 2, 3] my_list.append(4) print(len(my_list))

Q.2Easy

Which of the following is NOT a valid Python data type?

Q.3Easy

What will be the type of x after executing: x = [1, 2.5, 'hello']?

Q.4Easy

Which method removes and returns the last element from a list?

Q.5Easy

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

Q.6Medium

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

Q.7Medium

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

Q.8Medium

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

Q.9Medium

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

Q.10Medium

What is the difference between list and tuple in Python?

Q.11Medium

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

Q.12Medium

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.13Medium

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

Q.14Medium

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

Q.15Hard

What will be the output? my_list = [1, 2, 3] my_list_copy = my_list my_list[0] = 99 print(my_list_copy[0])

Q.16Hard

What is the correct way to create a true copy of a list?

Q.17Hard

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

Q.18Hard

What will be the result of executing this code? my_list = [1, 2, 3] my_list.insert(1, 99) print(my_list)

Q.19Hard

What will be printed? my_list = [1, 2, 3, 4, 5] print(my_list[::-1])