which information should be used as keys in a dictionary to store student data?
A better answer to this question would be to NOT use a Dictionary, instead making a class in a coded source file that can hold information about a Student, with properties for Name, School, Year, Birthdays etc, especially with the grades part which would get super messy in a Dictionary.
In this context, the clue should be that a Key in a dictionary should be unique. If you try to use the same key several times, you will get an error.
Option- 5 is correct
dictionary keys must be unique. Name, birthday, or school year can be duplicated, but a Student ID ensures uniqueness and accurate data retrieval.
Happy Automation
using same key to store info multiple times will not throw error. Instead it will override the last value saved for that key.
Update - Specifically in UiPath term where we use assign activity to add key into dictionary.
That depends on how you use the Dictionary,
As explained here, if you try to add a key several times you get an ArgumentException.
If you instead to it by just referencing the key then you will indeed override it as you say, but arguably thats not adding a key multiple times.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
