How to remove duplicate from the python list

Let’s say you have a list with duplicate entry like nums = [1, 2, 4, 5, 3, 4, 5, 9, 0, 0, 0, 2, 6, 7, 8, 1, 2, 6, 7]. Following code removes duplicate entry: Output should look like following: