I'm trying to sort a string (to make a genotype for a punnetsquare). My current implementation is:
unsorted_genotype = 'ABaB'
sorted_genotype = sorted(list(unsorted_genotype))
sorted_string = ''.join(sorted_genotype)
It outputs
'ABBa'
Though, I would want and expect:
'AaBB'
How can I change or fix this?