lexicographic-ordering

Sort list of strings ignoring upper/lower case

Sort list of strings ignoring upper/lower case Question: I have a list which contains strings representing animal names. I need to sort the list. If I use sorted(list), it will give the list output with uppercase strings first and then lowercase. But I need the below output. Input: var = [‘ant’,’bat’,’cat’,’Bat’,’Lion’,’Goat’,’Cat’,’Ant’] Output: [‘ant’, ‘Ant’, ‘bat’, …

Total answers: 3