iGET

Python Programming - MCQ Practice Questions

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

119 questions | 100% Free

Q.101Easy

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

Q.102Easy

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

Q.103Easy

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

Q.104Easy

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

Q.105Easy

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

Q.106Medium

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

Q.107Medium

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

Q.108Medium

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

Q.109Medium

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

Q.110Medium

What is the difference between list and tuple in Python?

Q.111Medium

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

Q.112Medium

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

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

Q.114Medium

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

Q.115Hard

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.116Hard

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

Q.117Hard

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

Q.118Hard

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

Q.119Hard

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