n = 6 lista = [0, 2, 4, 6, 8, 10, 0, 3, 6, 9, 12, 15]print(sorted(set(lista))[:n])
Standard input is empty
[0, 2, 3, 4, 6, 8]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!