A penal code is law enacted to establish a system of prohibitions, penalties, and correctional measures to deal with conduct that unjustifiably and inexcusably causes or threatens harm to those individual or public interests for which state protection is appropriate. A penal code aims to insure the public safety through:
A penal code defines and grades offenses to give fair warning of what is prohibited and of the consequences of violation. It also prescribes penalties that are proportionate to the seriousness of offenses and that permit recognition of differences in rehabilitation possibilities among individual offenders.