I have a text file, which contains a list of element and their weight, and i need to split the list up and sort it by the weight of the elements. So i need
to change the weight to a float.
The text file:
Ac 227.0
Ag 107.868
Al 26.98154
Am 241.1
Ar 39.948
As 74.9216
...
So far i have done this:
Code:
# ----The data structure----
# The input file
text_file=open("avikt.txt","r")