Not looking for a work around. Looking to understand why Python sorts this way.
>>> a = [\'aaa\',\'Bbb\']
>>> a.sort()
>>> print(a
Python treats uppercase letters as lower than lowercase letters. If you want to sort ignoring the case sensitivity. You can do something like this:
a = ['aaa','Bbb']
a.sort(key=str.lower)
print(a)
Outputs:
['aaa', 'Bbb']
Which ignores the case sensitivity. The key parameter "str.lower" is what allows you to do this. The following documentation should help. https://docs.python.org/3/howto/sorting.html