Why array is considered as right answer?

Hey,
Please refer to this picture.

At First glance, i thought answer will be dictionary because in my point of view, storing name of students of class should be like : key as Class1, value as list of students, key as class2, value as list of students; key as class3 , value as list of sudents and so on.

But UiPath shows answer as Array why ?

HI @prabin_chand1

Array is an collection of same datatype and has an fixed value. According to the above question there will be fixed number of students in a class. So all student names can be stored in an Array variable.

Hope this explanation helps!!

Regards,

Hi @prabin_chand1

Array is a collection of objects which shares a common property in general. Since the students belongs to the same class, it makes much more sense to save their data in an array variable like this:

classA = {student1, student2, student 3….}

Dictionary generally has a key-value pair structure of data storage & it won’t be an ideal think to save the data like this:

classA:student1, classA:student2, classA:student3

Hope this helps,
Best Regards.

@prabin_chand1

Yes, the answer is Array here

because the question is that how you will store Student names in a class or section

So let’s take Class as Array and in that arrClass = {“Ravi”, “Vijay”, “Srini”…etc}

Hope this answers your question

Thanks,
Srini