Attempt to commit culpable homicide.Whoever does any act with such intention or knowledge and under such circumstances that, if he by that act caused death, he would be guilty of culpable homicide not amounting to murder, shall be punished with imprisonment of either description for a term which may extend to three years, or with fine, or with both and, if hurt is caused to any person by such act, shall be punished with imprisonment of either description for a term which may extend to seven years, or with fine, or with both. Illustration A, on grave and sudden provocation, fires a pistol at Z, under such circumstances that if he thereby caused death he would be guilty of culpable homicide not amounting to murder. A has committed the offence defined in this section.