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.
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])
ginortS
You are viewing a single comment's thread. Return to all comments →
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)