Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
nicy solution in Speedy category for Sort by Extension by vladic4t
from typing import List
def sort_by_ext(files: List[str]) -> List[str]:
wExt = [f for f in files if f.split('.')[-1] != '' and f.split('.')[-2] != '' ]
oExt = list(set(files).difference(wExt))
wExt = sorted(wExt, key=lambda x: (x.split('.')[-1], x.split('.')[-2]))
oExt = sorted(oExt, key=lambda x: x.split('.')[-1] if x.split('.')[-1] != '' else x.split('.')[-2])
return oExt + wExt
July 17, 2020