If I have a list of strings, for example here's a small part of my list:

small_list=['HETATM 2142  O   DUM  2142     -26.000  -8.000  12.300','HETATM 2143  O   DUM  2143     -26.000  -6.000  12.300']

Is there a way to remove the 12.300 from a string in this list and then replace it with something else?

Recommended Answers

All 2 Replies

List comprehension

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.