We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
n = list(input())
n.sort()
lower, upper, odd, even = '', '', '', ''
for i in n:
if i.islower():
lower += i
elif i.isupper():
upper += i
elif i.isdigit() and int(i)%2 == 1:
odd += i
elif i.isdigit() and int(i)%2 == 0:
even += i
print(lower+upper+odd+even)
Enter your code here. Read input from STDIN. Print output to STDOUT
S = str(input())
upper = '' lower = '' num = ''
for i in range(len(S)): if S[i].isupper(): upper += S[i] elif S[i].islower(): lower += S[i] else: num += S[i]
odd = [i for i in num if int(i) % 2 != 0] even = [i for i in num if int(i) % 2 == 0]
sorted_upper = ''.join(sorted(upper)) sorted_lower = ''.join(sorted(lower)) sorted_odd = ''.join(sorted(odd)) sorted_even = ''.join(sorted(even))
print(f"{sorted_lower}{sorted_upper}{sorted_odd}{sorted_even}")
n = list(input()) n.sort() lower, upper, odd, even = '', '', '', '' for i in n: if i.islower(): lower += i elif i.isupper(): upper += i elif i.isdigit() and int(i)%2 == 1: odd += i elif i.isdigit() and int(i)%2 == 0: even += i print(lower+upper+odd+even)
if name == 'main':