You answeredJUST NOW
Python
STDIN
1 1 2 3 4
Expected STDOUT
[2, 3, 4]
Your STDOUT
[2, 3, 4]
STDIN
1 1 2 2 3 3
Expected STDOUT
[]
Your STDOUT
[]
STDIN
1 2 2 3
Expected STDOUT
[1, 3]
Your STDOUT
[1, 3]
STDIN
22 55
Expected STDOUT
[22, 55]
Your STDOUT
[22, 55]
STDIN
1 2 3 4 5
Expected STDOUT
[1, 2, 3, 4, 5]
Your STDOUT
[1, 2, 3, 4, 5]
STDIN
1 5 3 5 2
Expected STDOUT
[1, 3, 2]
Your STDOUT
[1, 3, 2]
Instructor solution
Collections in Python Presentation (pages 3, 4, 7, 8)
By Alec Kretch (Aug 6, 2023)
You may exit out of this review and return later without penalty.

CLOSE REVIEW![def remove_dups(a_list):
counts = {} # Count how many times each value appears in a_list
# Iterate a_list twice...
# First time to count occurrences of each value
for val in a_list:
if val in counts:
counts[val] += 1
else:
counts[val] = 1
# Second time to build up our return list
no_dups_list = []
for val in a_list:
if counts[val] < 2:
no_dups_list.append(val)
return no_dups_list](/files/6003ac23eb421f054258b59e.png)