From the course: Scala Essential Training for Data Science

Unlock this course with a free trial

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

Solution: Create arrays, vectors, and ranges

Solution: Create arrays, vectors, and ranges

From the course: Scala Essential Training for Data Science

Solution: Create arrays, vectors, and ranges

- [Instructor] The solution to this CoderPad exercise is as follows. To declare an array event with the values one to five, we specify array, and simply the numbers we want in the array. 1, 2, 3, 4, and 5. To create a vector of strings, we use the term Vector, followed by the strings one, two, and three. And then finally, to specify the range, we simply say 1, let's say to 100 by 1, and let's test the code. And that is the solution to this exercise.

Contents