You are viewing a single comment's thread. Return to all comments →
if name == 'main':
S = input() def custom_key(Char): if Char.islower(): return(0 , Char) elif Char.isupper(): return(1 , Char) elif Char.isdigit(): return (2 if int(Char) % 2 else 3, Char) sorted_string = ''.join(sorted(S , key =custom_key)) print(sorted_string)
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 →
if name == 'main':