In any prosecution for an offense, it is an affirmative defense that, in order to obtain evidence of the commission of an offense, a public law enforcement official or a person working in cooperation with the official induced the defendant to commit the offense by persuasion or inducement as would be effective to persuade an average person, other than one who is ready and willing, to commit the offense. Inducement or persuasion which would induce only a person engaged in an habitual course of unlawful conduct for gain or profit does not constitute entrapment.