Skip to content

Commit 6cc6537

Browse files
Update remove_duplicates.py
1 parent 4d26c4a commit 6cc6537

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

2_intermediate/chapter11/practice/remove_duplicates.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
# The function should look through a list,
44
# Find all duplicate elements, and remove them
55
# Sort the resulting list
6-
# YOU MAY NOT USE THE set() function IN PYTHON. Use this problem to practice list iteration!
6+
# YOU MAY NOT USE THE set() function IN PYTHON.
77
# Hint: To sort a list, use sorted(list)
8-
# Another hint: Use list.count(element)
9-
# To count the number of times that element appears
8+
# Another hint: Use dict.removekeys(list)
9+
# To take the elements from a list,
10+
# and convert them to keys in a dictionary
1011

1112
# Example: array = [1,1,2,5,4,6,12,3,4,6]
1213
# Result should print [1,2,3,4,5,6,12]

0 commit comments

Comments
 (0)