• + 1 comment
    num_odd,num_even,low,cap="","","","" 
    for i in range(len(s)):
        if s[i].lower() == s[i]:
            if s[i].isdigit():
                if int(s[i]) % 2:
                    num_odd += (s[i]) 
                else:
                    num_even += (s[i]) 
            else:
                low += s[i]
        else:
            cap += s[i]
    s = low+cap+str(num_odd)+str(num_even)
    print(s)