back-end code for the alx specialisation in python