Under section 511 PPC, an attempt means an act done with the intention of committing an offence, and in the attempt itself, going beyond mere preparation towards its commission. The empty-pocket illustration attached to the section treats the pickpocket as guilty of an attempt to steal, so factual impossibility is no defence once the offender has taken the last proximate step. Preparation, such as buying a weapon or shadowing a target, is ordinarily not punishable unless it amounts to conspiracy or a distinct offence. Trap: the punishment for such an attempt is one half of the longest term provided for the offence, not the full term.