312. If, at the time of attempting to commit robbery or dacoity, the offender is armed with any deadly weapon, the imprisonment with which such offender shall be punished shall not be less than seven years.
Bharatiya Nyaya Sanhita, 2023
Section 312: Attempt to commit robbery or dacoity when armed with deadly weapon
Chapter XVII — Of Offences Against Property
Source: official text of the Bharatiya Nyaya Sanhita, 2023 (Ministry of Home Affairs).