I have a list called V. The elements of V will be one of be one of: 0,1,2 or +inf
I would like to sort this list such that 2 is always at the beginning and the list is sorted in ascending order from then on.
For example, if the list is initially V = [0,1,2,inf] It should then become V = [2,0,1,inf]
I have a good idea of how to do this with conditionals and appending into a new list, but if possible I'd like to sort this with a key or a comprehension.
I am writing this in Python3 but I would prefer to not import anything