Whoever attempts unsuccessfully to commit an offense and accomplishes the commission of another and different offense, whether greater or lesser in guilt, shall be punished as prescribed by law for the offense committed, notwithstanding the provisions of section 331 of this title.