Multiple choice technology platforms and products

length_of([vector "I" , "LOVE" , "INDIA"])

  1. 11

  2. 3

  3. 1

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The vector ["I", "LOVE", "INDIA"] contains exactly 3 elements. The length_of function returns the number of elements in the vector, not the total character count of all strings. Therefore, the correct answer is 3, not 11 (which would be the sum of character lengths).

AI explanation

length_of applied to a vector returns the number of elements the vector contains, not the total character count of its contents. The vector ["I", "LOVE", "INDIA"] has exactly three elements, so the length is 3.