You are viewing a single comment's thread. Return to all comments →
one solution using filter()
s = sorted(input()) num= list(filter(str.isnumeric, s )) odd =list(filter(lambda x: int(x) % 2 != 0, num)) even = list(filter(lambda x: int(x) % 2 == 0, num)) lower = list(filter(str.islower, s)) upper = list(filter(str.isupper, s)) print(*(lower + upper + odd + even), sep='')
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 →
one solution using filter()