Butterflies can learn a range of different kinds of things.
If they are given a nectar or sugar reward in association with a particular color, they will quickly learn to choose that color from an array of colors. They can also learn to associate a color or leaf shape with a chemical that stimulates them to lay eggs. For example, once a female pipevine Swallowtail has laid an egg on a leaf of pipevine, the only host plant she will accept, she will be more likely to search out and land on leaves of a similar shape. Butterflies also become more adept at extracting nectar from complex flowers, as they learn to insert their tongues into the appropriate location, and the proper angle. Some butterflies may even be able to learn spatial locations.