Remove Duplicates
beginnerUp next
Up next
Output will appear here...
The starter code reads a line of integers into a list called numbers. Print the numbers with duplicates removed, keeping the first appearance of each and preserving the original order. Print them on one line separated by spaces.
For the input 1 2 2 3 1, a correct solution prints:
1 2 3
Tip
Start with an empty list. Loop over numbers and only .append() a value if it is not in your new list yet. Then use print(*result).
No comments yet. Start the discussion.