From the course: Scala Essential Training for Data Science

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Solution: Create functions

Solution: Create functions

- [Instructor] Okay, here's the solution. So, basically, we are going to compute 2 times the product of a and b, which are our parameters, and we're going to divide that by the sum of those two parameters, a plus b, and we're going to return those by using the term return. So, the two steps of the solution are to define the formula and then to specify that the result of that calculation is what we will actually return. And the code is correct.

Contents