Section 82 IPC provides the infancy exception - nothing is an offense which is done by a child under 7 years of age. This is based on the principle that a child of this age lacks sufficient maturity to understand the consequences of their actions (doli incapax).