Explain the punishment for rape as outlined in Indian Penal Code (IPC 1860) Section 376: Punishment for rape and their relevant Bharatiya Nyaya Sanhita 2023 (BNS 2023) code reference.

{'IPC Section': '376', 'IPC Heading': 'Punishment for rape', 'IPC Descriptions': ' Indian Penal Code, 1860 
[376. Punishment for rape
(1) Whoever, except in the cases provided for by subsection (2),
commits rape shall be punished with imprisonment of either description for a
term which shall not be less than seven years but which may be for life or for
a term which may extend to ten years and shall also be liable to fine unless
the women raped is his own wife and is not under twelve years of age, in which
cases, he shall be punished with imprisonment of either description for a term
which may extend to two years or with fine or with both:
Provided  that the court may, for adequate and special
reasons to be mentioned in the judgment, impose a sentence of imprisonment for
a term of less than seven years.
(2) Whoever,
(a) being a police officer commits rape
(i) within the limits
of the police station to which he is appointed; or
(ii) in the premises of any station house
whether or not situated in the police station to which he is appointed; or
(iii) on a woman in his custody or in the
custody of a police officer subordinate to him; or
(b) being, a public servant, takes advantage
of his official position and commits rape on a woman in his custody as such
public servant or in the custody of a public servant subordinate to him; or
(c) being on the management or on the staff of
a jail, remand home or other place of custody established by or under any law
for the time being in force or of a woman\'s or children\'s institution takes
advantage of his official position and commits rape on any inmate of such jail,
remand home, place or institution; or
(d) being, on the management or on the staff
of a hospital, takes advantage of his official position and commits rape on a
woman in that hospital; or
(e) commits rape on a woman knowing her to be pregnant;
or
(f) commits rape on a woman when she is under
twelve years of age; or
(g) commits gang rape, shall be punished with
rigorous imprisonment for a term which shall not be less than ten years but
which may be for life and shall also be liable to fine:
Provided  that the court may, for adequate and special
reasons to be mentioned in the judgment, impose a sentence of imprisonment of
either description for a term of less than ten years.
Explanation 1  Where a woman is raped by one or more in a
group of persons acting in furtherance of their common intention, each of the
persons shall be deemed to have committed gang rape within the meaning of this
subsection.
Explanation 2  "Women\'s or children\'s institution"
means an institution, whether called an orphanage or a home for neglected woman
or children or a widows\' home or by any other name, which is established and
maintained for the reception and care of woman or children.
Explanation 3  "Hospital" means the precincts of
the hospital and includes the precincts of any institution for the reception
and treatment of persons during convalescence or of persons requiring, medical
attention or rehabilitation.]', 'BNS Section': '64', 'BNS Heading': 'Punishment for rape', 'BNS description': 'The Bharatiya Nyaya Sanhita, 2023
64. Punishment for rape.
(1) Whoever, except in the cases provided for in subsection (2), commits rape, shall be punished with rigorous imprisonment of either description for a term which shall not be less than ten years, but which may extend to imprisonment for life, and shall also be liable to fine.
(2) Whoever,
(a) being a police officer, commits rape,
(i) within the limits of the police station to which such police officer is appointed; or
(ii) in the premises of any station house; or
(iii) on a woman in such police officer\'s custody or in the custody of a police officer subordinate to such police officer; or
(b) being a public servant, commits rape on a woman in such public servant\'s custody or in the custody of a public servant subordinate to such public servant; or
(c) being a member of the armed forces deployed in an area by the Central Government or a State Government commits rape in such area; or
(d) being on the management or on the staff of a jail, remand home or other place of custody established by or under any law for the time being in force or of a women\'s or children\'s institution, commits rape on any inmate of such jail, remand home, place or institution; or
(e) being on the management or on the staff of a hospital, commits rape on a woman in that hospital; or
(f) being a relative, guardian or teacher of, or a person in a position of trust or authority towards the woman, commits rape on such woman; or
(g) commits rape during communal or sectarian violence; or
(h) commits rape on a woman knowing her to be pregnant; or
(i) commits rape, on a woman incapable of giving consent; or
(j) being in a position of control or dominance over a woman, commits rape on such woman; or
(k) commits rape on a woman suffering from mental or physical disability; or
(l) while committing rape causes grievous bodily harm or maims or disfigures or endangers the life of a woman; or
(m) commits rape repeatedly on the same woman, shall be punished with rigorous imprisonment for a term which shall not be less than ten years, but which may extend to imprisonment for life, which shall mean imprisonment for the remainder of that person\'s natural life, and shall also be liable to fine.
Explanation.For the purposes of this subsection,
(a) "armed forces" means the naval, army and air forces and includes any member of the Armed Forces constituted under any law for the time being in force, including the paramilitary forces and any auxiliary forces that are under the control of the Central Government or the State Government;
(b) "hospital" means the precincts of the hospital and includes the precincts of any institution for the reception and treatment of persons during convalescence or of persons requiring medical attention or rehabilitation;
(c) "police officer" shall have the same meaning as assigned to the expression "police" under the Police Act, 1861;
(d) "women\'s or children\'s institution" means an institution, whether called an orphanage or a home for neglected women or children or a widow\'s home or an institution called by any other name, which is established and maintained for the reception and care of women or children.'}