Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- word = input()
- lower_case = [char for char in word if char.islower()]
- upper_case = [char for char in word if char.isupper()]
- digit_odd_case = [char for char in word if char.isdigit() and int(char) % 2]
- digit_even_case = [char for char in word if char.isdigit() and int(char) % 2 == 0]
- lower_case = ''.join(sorted(lower_case))
- upper_case = ''.join(sorted(upper_case))
- digit_even_case = ''.join(sorted(digit_even_case))
- digit_odd_case = ''.join(sorted(digit_odd_case))
- print(lower_case + upper_case + digit_odd_case + digit_even_case)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement