We also trained flies to associate odors with sucrose (Fig. 1d, Supplementary Fig. 3b), a substance known to be rewarding to flies. Sucrose-conditioned flies showed reduced aversion to the 100 V but not the 120 V grid (Fig. 1d). Thus, flies tolerated punishment (electrical shock) in order to approach an odor cue predictive of ethanol or sucrose reward. Intriguingly however, ethanol-conditioned flies tolerated a larger electric shock than sucrose-conditioned flies.