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)
lowercase = sorted([c for c in s if c.islower()])
uppercase = sorted([c for c in s if c.isupper()])
odd = sorted([c for c in s if c.isdigit() and int(c)%2 !=0])
even = sorted([c for c in s if c.isdigit() and int(c)%2 ==0])
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':
s = input()
lowercase = sorted([c for c in s if c.islower()]) uppercase = sorted([c for c in s if c.isupper()]) odd = sorted([c for c in s if c.isdigit() and int(c)%2 !=0]) even = sorted([c for c in s if c.isdigit() and int(c)%2 ==0])
sorted_s = ''.join(lowercase+uppercase+odd+even) print(sorted_s)
name = input() sorted_data = ''.join(sorted(name,key=lambda x:( x.isdigit(), x.isdigit() and int(x)%2==0, x.isupper(), x ))) print(sorted_data)
That's it