  A simple Monte Carlo (MC) algorithm for the simulation of the passage of
low-energy gamma rays and electrons through any material medium is presented.
The algorithm includes several approximations that accelerate the simulation
while maintaining reasonably accurate results. Systematic comparisons for both
photons and electrons have been made against the MC code PENELOPE and
experimental data to validate the algorithm, showing deviations in the
deposited energy smaller than or around 10% in the energy interval of 0.1 - 5
MeV in light media. The simulation is also valid for heavy media, but with less
accuracy at high energy. The algorithm has been implemented in an open-source
Python package called LegPy, which provides an easy-to-use framework for rapid
MC simulations aiming to be useful for applications that do not require the
level of detail of available well-established MC programs.
