Neural Sync Active
jan-2026-python-week-7-collections-2
Registry Synced
jan-2026-python-week-7-collections-2
626 words
3 min read
Collections 2
Course: Jan 2026 - Python
Collections 2
Submission deadline has passed for this assignment
Due Apr 01, 2026 at 11:59 PM IST
Instructions
Use "Test Run" to verify your code with public test cases.
Press "Submit" to have your assignment evaluated.
You can submit your assignment multiple times up until the deadline.
Make sure to submit your final code by the deadline to receive your score.
Summary
100 out of100
Score
Public Tests
3/3 Passed
Submitted on Apr 01, 2026 at 3:49 AM IST
Private Tests
2/2 Passed
Submitted on Apr 01, 2026 at 3:50 AM IST
**Change in eligibility criteria to write oppe2 exam: A5>=40/100 AND A6>=40/100 AND A7>=40/100 AND A8>=40/100. and becoming eligible to give the end term exam.
Delete the first three elements in a list**
Given a list
l, modify it in place by deleting the first three elements. If the list has fewer than three elements, delete all elements.Example
l = [1, 2, 3, 4, 5]
After deleting the first three elements, the list becomes
[4, 5].Template Code(Click to Expand)
def delete_first_three(l: list) -> None: ''' Given a list, delete the first three elements in the list. Arguments: l: list - a list of elements. Return: None - the list is modified in place. ''' ...
NOTE: You can use the below tools for working out and debugging. Click to open them in new tab.
Public Tests ( 3/3 )
Case 1
Input:
textl = [10, 20, 30, 40, 50] modify_check( lambda x: delete_first_three(x), l, [40, 50], should_modify=True )
Case 1
Expected Output:
text[40, 50]
Case 1
Actual Output:
text[40, 50]
Case 2
Input:
textl = [1, 2, 3, 4, 5, 6, 7] modify_check( lambda x: delete_first_three(x), l, [4, 5, 6, 7], should_modify=True )
Case 2
Expected Output:
text[4, 5, 6, 7]
Case 2
Actual Output:
text[4, 5, 6, 7]
Case 3
Input:
textl = [1, 2] modify_check( lambda x: delete_first_three(x), l, [], should_modify=True )
Case 3
Expected Output:
text[]
Case 3
Actual Output:
text[]
Private Tests ( 2/2 )
Case 1
Input:
textl = [3, 4, 5] modify_check( lambda x: delete_first_three(x), l, [], should_modify=True ) l = [7, 8, 9, 10, 11] modify_check( lambda x: delete_first_three(x), l, [10, 11], should_modify=True ) l = [1, 2, 3, 4, 5, 6, 7, 8, 9] modify_check( lambda x: delete_first_three(x), l, [4, 5, 6, 7, 8, 9], should_modify=True )
Case 1
Expected Output:
text[] [10, 11] [4, 5, 6, 7, 8, 9]
Case 1
Actual Output:
text[] [10, 11] [4, 5, 6, 7, 8, 9]
Case 2
Input:
textl = [3, 4] modify_check( lambda x: delete_first_three(x), l, [], should_modify=True ) l = [] modify_check( lambda x: delete_first_three(x), l, [], should_modify=True ) l = [10, 11, 12, 13, 14] modify_check( lambda x: delete_first_three(x), l, [13, 14], should_modify=True )
Case 2
Expected Output:
text[] [] [13, 14]
Case 2
Actual Output:
text[] [] [13, 14]
💻 IITM Official Solution
pythondef delete_first_three(l: list) -> None: ''' Given a list, delete the first three elements in the list. Arguments: l: list - a list of elements. Return: None - the list is modified in place. ''' del l[:3]
💻 My Submitted Code
pythondef delete_first_three(l: list) -> None: # Option 1: Use the del keyword (Very efficient) del l[:3] # Option 2: Slice assignment (Also modifies in-place) # l[:] = l[3:]