If, on the trial of a person for any indictable offence, the jury is not satisfied that the person is guilty of the offence, but is satisfied that he or she is guilty of--
(a) an attempt to commit the offence, or
(b) an assault with intent to commit the offence,it may acquit the person of the offence charged and find the person guilty of the attempt or assault, and the person is liable to punishment accordingly.