Lists and collections · Python exercise
Remove repeated values while preserving first-seen order.
Read one line of space-separated values and print the values with duplicates removed. Keep the order in which each value first appears.
Example 1
Input
1 2 2 3 1
Output
1 2 3
Example 2
Input
5 5 5
Output
5
How testing works
Your code runs once per test case with that case's standard input. Output is compared after normalising trailing spaces and blank lines at the end. Use input() without a prompt when the exercise expects clean output.
Loading editor…
Press Run tests to execute your code against every input case. Python runs in a Web Worker in your browser.