read the file and print list in ascending order of there names using python
my file content is like this
Summeet : 82736
David : 55283
Vinay :22783
James :19923
Santosh :77283
Victor : 92384
Amit :66271
Harry : 38273
read the file and print list in ascending order of there names using python
my file content is like this
Summeet : 82736
David : 55283
Vinay :22783
James :19923
Santosh :77283
Victor : 92384
Amit :66271
Harry : 38273
If this is not a homework and you need this in a linux system, don't use python but rather sort
:
cat myfile.txt | sort
If you really need python, here are some tips:
arr = []
sorted_arr = sorted(arr)
method to sort the lines