Simple functional programning with python