You could use a custom comparator function, as described in https://wiki.python.org/moin/HowTo/Sorting#The_Old_Way_Using_the_cmp_Parameter.
Or you can use a key function (by passing the key keyword argument to list.sort) to transform the value being sorted to a different one:
>>> ls = ['qa','uat','prod','dev']
>>> ls.sort(key=lambda x: (1,x) if x=='dev' else (0,x))
>>> ls
['prod', 'qa', 'uat', 'dev']
>>>
or do the same thing with a function:
>>> def my_key_func(x):
... if x=='dev':
... return (1,x)
... else:
... return (0,x)
...
>>> ls.sort(key=my_key_func)
>>> ls
['prod', 'qa', 'uat', 'dev']
>>>