Exercises Weather Forecast

Make a vector

Make a vector of the high temperatures for the next 7 days in the town where you live. Then use the nth function to get the high temperature for Tuesday.

()
Reveal answer...
;; A vector of the temperatures for the next week
[9 2 -3 4 5 9 4]

;; assuming the first temperature is for Monday, then to get Thursday we can write
(nth [9 2 -3 4 5 9 4] 3)

Remember that the index of a vector starts at zero

results matching ""

    No results matching ""