Answer:
B. By mutating their DNA in response to environmental conditions to gain beneficial traits
Step-by-step explanation:
Through the process of natural selection, bacteria such as E coli can gain new traits that benefit them.
This can occur when a DNA mutation occurs, where the mutated gene is actually beneficial to respond to environmental conditions.
Then, these bacteria with the gene will survive and produce more offspring with the same gene. This is how E coli can develop antibiotic resistance.
So, B is the correct answer.