You are viewing a single comment's thread. Return to all comments →
my_string = ''.join(sorted(input())) lower_case = [] upper = [] num = [] for c in my_string: if c.islower(): lower_case.append(c) elif c.isupper(): upper.append(c) else: num.append(c) num = sorted(num, key=lambda x: (int(x) % 2 == 0, int(x))) print(''.join(lower_case + upper + num))
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 →