python script to sort file content

Solutions on MaxInterview for python script to sort file content by the best coders in the world

showing results for - "python script to sort file content"
Frieda
05 Jun 2020
1with open('shopping.txt', 'r') as r:
2    for line in sorted(r):
3        print(line, end='')