Python how to sorting the text code example
Example: python script to sort file content
with open('shopping.txt', 'r') as r:
for line in sorted(r):
print(line, end='')
with open('shopping.txt', 'r') as r:
for line in sorted(r):
print(line, end='')