@mcnado I know you know, but you are misleading people with your metaphor. The process you describe is not about bacteria “learning.” Learning is a process by which individuals change in response to experience. Evolution is a process by which populations change in response to experience.
You are describing evolution by natural selection against the more susceptible bacteria. The natural selection is caused by the antibiotic in their environment.