You are viewing a single comment's thread. Return to all comments →
Created a sort function instead of breaking up the types into separate strings. Same idea though.
def sort_func(x): if x.islower(): return 'a' + x elif x.isupper(): return 'b' + x elif x.isnumeric() and int(x)%2: return 'c' + x else: return 'd' + x
ginort = sorted(input(), key = sort_func) print(''.join(ginort))
Seems like cookies are disabled on this browser, please enable them to open this website
ginortS
You are viewing a single comment's thread. Return to all comments →
Created a sort function instead of breaking up the types into separate strings. Same idea though.