You are viewing a single comment's thread. Return to all comments →
string = input() sorted_lowercase = '' sorted_uppercase = '' sorted_odd = '' sorted_even = '' string = sorted(string) for char in string: if char.islower(): sorted_lowercase += char elif char.isupper(): sorted_uppercase += char if char.isdigit() and int(char) % 2 is not 0: sorted_odd += char elif char.isdigit() and int(char) % 2 == 0: sorted_even += char print(sorted_lowercase + sorted_uppercase + sorted_odd + sorted_even)
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 →