Govt. Exams
Entrance Exams
my_list = [1, 2, 3, 4, 5]
print(my_list[::-1])
Slice [::-1] reverses the list by using step -1 (backwards through entire list). It returns a reversed copy.
my_list = [1, 2, 3]
my_list.insert(1, 99)
print(my_list)
insert(1, 99) inserts 99 at index 1, shifting existing elements right. Result is [1, 99, 2, 3].
my_list = [1, 2, 3, 4, 5]
print(my_list[-2])
Negative indexing starts from the end: -1 is 5, -2 is 4, -3 is 3, etc. So -2 returns 4.
Both .copy() method and list() constructor create shallow copies. Simple assignment creates only a reference.
my_list = [1, 2, 3]
my_list_copy = my_list
my_list[0] = 99
print(my_list_copy[0])
Assignment creates a reference, not a copy. Both variables point to the same list object, so changes are reflected in both.
Lambda functions are functions in Python. type(lambda x: x) returns <class 'function'>.
x = 5 is a class variable. It can be accessed via A.x and modified via A.x = new_value or instance modification.
Dictionary comprehension creates {0: 0, 1: 1, 2: 4} where keys are from range(3) and values are their squares.
The 'with' statement ensures the file is automatically closed when the block exits, even if an error occurs.
eval() evaluates the string as Python code following operator precedence. 2+3*4 = 2+12 = 14.
About Python Programming Practice on iGET
iGET offers 25+ free Python Programming MCQ questions covering all important topics. Each question is prepared by subject experts and comes with detailed explanations to help you understand concepts deeply, not just memorize answers.
Why prepare with iGET?
100% free access, timed mock tests, instant results with detailed analysis, topic-wise progress tracking, and bookmark feature for revision. Trusted by thousands of aspirants preparing for UPSC, SSC, Bank, Railway, NEET, JEE and other competitive exams across India.
How to use this page effectively
Start by selecting a difficulty level (Easy / Medium / Hard) or pick a specific topic from the topics strip. Attempt questions, check your answer instantly, read the explanation carefully, and bookmark tricky ones for later revision. For full exam-style practice, take a Mock Test from the right sidebar.