Single Variable Function Reduce Python