Reduce Python Geeksforgeeks Example