use lambda to sort alphabetically python code example
Example: sort list alphabetically python
my_list = ['pera', 'apple', 'orange', 'grape']
my_list.sort() # ['apple', 'grape', 'orange', 'pera']
my_list = ['pera', 'apple', 'orange', 'grape']
my_list.sort() # ['apple', 'grape', 'orange', 'pera']